[thelist] Nav Bars with ASP Includes (was ASP Beginner Help Please)
Michele Foster
michele at wordpro.on.ca
Tue Mar 21 13:05:27 2000
Aardvark and others..
[quote]
if you want certain nav elements to be different depending on which
page you are visiting, capture the name of the current script using
Request.ServerVariables("SCRIPT_NAME") ...set that equal to a
variable so it's easier to call...
then you can compare the name of the current script with a
predefined option to see if it qualifies, and then display the
appropriate image:
<% ScriptName = Request.ServerVariables("SCRIPT_NAME") %>
<% IF instr(1,ScriptName,"overview/",1) > 0 then %>
<b> show HTML here</b>
<% ELSE %>
<b> show HTML here</b>
<% END IF %>
the instr() function simply says if the name of the current script
includes the word 'overview,' then display the first option, otherwise
display the second...
[/quote]
Hi again,
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?
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. 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?
If it is easier to send me to a URL tutorial that would be fine.
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?
TIA again,
Michele