[thelist] Nav Bars with ASP Includes (was ASP Beginner Help Please)

aardvark roselli at earthlink.net
Tue Mar 21 13:22:56 2000


> From: "Michele Foster" <michele@wordpro.on.ca>
>
> I think I understand what you are suggesting here.  But I do not
> follow you at all.  I think what you mean, is the sort of setup I have
> at this site http://elitemotelprop.com whereby the mouseover in the
> navigation is inactive on the current page being viewed and the image
> is set to the "off" position, in this particular case.  Is this
> correct?

the button that denotes the current page can be set to an 'inactive' 
state if the script knows that the user is on that page... so, instead 
of a dozen include files, you have one file that determines, from 
page to page, which buttons or other elements are displayed or not 
displayed... the URL you provide gives me a DNS error...

> As far as what you've suggested I do to handle these situations, I
> don't understand what the above means.  This is a simple site, only 6
> pages or so, but I have other sites where the navigation idea is the
> same for certain pages.  Example, http://wordpro.on.ca/mish/mishka.htm
> where anything in the jokes section would have a different "include"
> file that turns off the mouseover event and sets the image to static.

ok... but i generally have a third image to indicate a current page 
that is different from the rollover version...

> I think what you are saying above is that I don't need a NEW include
> file for this, but I need to have a way to tell the asp include file
> what to display if this page is part of the jokes section.   I don't
> understand what you mean by setting variable, where, in which file, my
> "static" file that calls the includes, or in the "include" file
> itself?

the variable you set is actually the name of the current script... 
Request.ServerVariables("SCRIPT_NAME") will tell you what the 
filename (and path from the root) of the current script is... if that 
code is an include, it will still tell the name of the script including 
the file (see the include tutorial)... so, you simply have some logic 
that, depending on the script name, will display elements 
appropriate to that script...

i don't think i can explain it any other way, unfortunately... try my 
code from my last email... paste it into a file called overview.asp 
and see what happens... play around, you'll get it..

> If it is easier to send me to a URL tutorial that would be fine.

don't have one, but thinking of writing one...

> Also, when creating the files to be included, do I stick with relative
> paths (i.e. http://wordpro.on.ca/image1.gif) so that no matter what
> directory the file that is pulling in the "include", all images, and
> links will be correct?

actually, that would be an absolute path... try root-relative paths, or 
just make sure your pages that utilize that include all exist on the 
same directory level...