[thelist] SSI - smart navigation/links

aardvark roselli at earthlink.net
Mon Nov 25 23:43:01 CST 2002


> From: "Roger Harness" <magic32 at jps.net>
[...]
> My question is, is there a way to specify links based on what page im
> actually on? I mean, simply, utilizing SSI, can I bold just the
> "contact" page in my navigation (for instance)?
[...]

well, matt and rudy have shown you in CF  ad XSSI...

to do a similar thing in ASP, in your navigation include try some of
this:
<%
'## get the name of the current script
ScriptName = Request.ServerVariables("SCRIPT_NAME")
%>
<% IF instr(1,ScriptName,"/adrian/books/") > 0 THEN %>
Books
<% ELSE %>
<a href="/adrian/books/">Books</a>
<% END IF %>

i use the instr() function to see if the specified text exists within
the script name, as opposed to an exact match... this means that the
word 'Books' wouldn't be a link for any page in that directory, and
it also means i can have it staged in a subdirectory of a site and
moved to the root of my production site and still have the nave
work...

alternative options include inline styles/classes:

<a href="/adrian/books/usability.asp" title="May 2002"<% IF
instr(1,ScriptName,"/adrian/books/usability.asp") > 0 THEN %>
class="selected"<% END IF %>>Usability: The Site Speaks for
Itself</a>

this way i'm not mainting two discrete chunks of text, just the class
associated with a link...

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





More information about the thelist mailing list