[thelist] SSI - smart navigation/links

matt g mrg at members.evolt.org
Mon Nov 25 23:23:00 CST 2002


> From: "Roger Harness" <magic32 at jps.net>

> Ok, I'm re-doing my current site. Switching from frames to SSI. Have my
> normal left hand navigation, and also would like to have the same nav'
> repeated at the bottom of the page.
>
> 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)?

Hi Roger,
If you have access to a server scripting language (Cold Fusion, PHP, ASP,
whatever) it can be pretty easy to do this kind of thing.

The trick is to declare what section you are in (or page you are on), before
you include the file with the nav links. In Cold Fusion it would go like
this...

On the "Stuff" page:
<cfset thisArea="stuff">
<cfinclude template="nav.cfm">

Then, in the included file, you test for what section you are in:

<cfif thisArea IS 'things'>
    Show this as the current section
<cfelse>
    Show this as a plain link
</cfif>
<cfif thisArea IS 'stuff'>
    Show this as the current section
<cfelse>
    Show this as a plain link
</cfif>
etc...

There should be simple equivalents in whatever language you have access to.
Hopefully, that's enough to get you underway.

matt g.




More information about the thelist mailing list