[thelist] SSI's: what are the rules for depth and variable scope? (aardvark, a little help?)

Chris W. Parker cparker at swatgear.com
Fri Jun 7 18:29:01 CDT 2002


hi.

i'm using iis5 and i'm trying to take an idea aardvark had (i'm pretty
sure it was him) and apply it to the site i'm working on.

i had a few pages converted and everything was going fine until this
last page. the problem is that the page that contains the content is not
able to access the included information from the template.

here is how it works.

pageA is the content.
pageB is the template.

pageB is included in pageA. so pageA is basically the parent of pageB.

pageA contains something like:

<% Sub Content %>
hello
<% End Sub %>
<!--#include file="pageB.asp"-->

and pageB is something like...

<html>
<body>
<% Content %>
</body>
</html>


however, both pageA AND pageB need to use the same source file. we'll
call that pageC.

so if i do an include statement of pageC inside both pages A and B i get
an error. (i've seen a few different errors depending on which
combination of where and what include so i don't know if this is the
correct error exactly) "Name Redefined". and that would of course be
because both files are being included and therefore variables are being
redefined. that makes sense.

ok so then lets get rid of the include page in pageA and just keep it in
pageB. then i get a Type Mismatch error on a specific function that is
found in pageC.

pageA calls pageB, pageB calls pageC (because pageB needs some functions
in pageC), and pageA also needs some functions in pageC so it calls it
as well. but like i just explained this causes and error. and if i take
one of the references out, the page that is not including the file
cannot see the included content and therefore throws an error anyway.
type mismatch.

what the heck should i do?

the only thing i can think of is instead of having one large include
file that contains many functions, i separate the large file into
smaller includes which contain only the functions specificaly needed by
each page. but what happens when the template file (pageB) and the
content file (pageA) need the same function? then that solution won't
work either.

is there any way around this?!?!?!


thanks,
chris.






More information about the thelist mailing list