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

aardvark roselli at earthlink.net
Fri Jun 7 20:21:01 CDT 2002


sorry for the delay, two happy hours with clients...  way too much
pepsi, coke, and celery...

> From: "Chris W. Parker" <cparker at swatgear.com>
[...]
> 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.

from what i see, it's one i proposed, yes... it's also what i use on
my site and a few client sites...

> 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>

with you so far...

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

what source file?  perhaps a breadcrumb function?

> 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.

right... but don't include anything in your content page -- only
include files into the template, and then the template gets included
(with its includes) into the content page...  only *one* include on
your content page...

> 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.

dump all the code from C into B at the point of the include... do you
get the same error?  if so, it's the VBScript, if not, well, i'd need
to look at what the heck you're doing...

> 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.

well, only call the file (C) once (in B), not in both pages...

> what the heck should i do?

try what i said above -- copy your content page, dump all the code
from the appropriate page into the place it's included...

lemme know what happens then...

> 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.

i have all functions in different files (C-Z), then all included into
the template (B)... the content page (A) *never* includes anything
more than the template...

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

yes, but i dunno what it is yet... lemme know how my suggestions work
out, and worst-case scenario, you send me some files offlist and i
play around with them...

--
Read the evolt.org case study
Usability: The Site Speaks for Itself
http://amazon.com/exec/obidos/ASIN/1904151035/evoltorg
ISBN: 1904151035





More information about the thelist mailing list