[thelist] PHP - good ways to indicate current page in navigation?

Christian Heilmann codepo8 at gmail.com
Tue Jul 25 06:09:24 CDT 2006


> > 1) Keep all the navigation in one HTML include that is a nested list
> > 2) Include this list in each document and compare the current location
> > (PHP_SELF) with the links in the include.
> > 3) When there is a match, replace the link with a STRONG element and
> > add a "parent" CSS class to each LI above the one that has a replaced
> > link
> >
> > All wrapped up: http://www.onlinetools.org/tools/easynav/
> >
> > ...Even styling it is easy as you can style li strong{} as the current
> > element.
> >
> > CSS is there to host the look and feel, don't use it to take over the
> > job of HTML or JavaScript, it is just not reliable.
>
> Not reliable when JavaScript is turned off - rare, but still a possible
> setback; and possibly more common than CSS turned off?  It's a tough call -
> rely on JavaScript, or CSS?
>
> I've looked over the article you referenced before, looks promising.

What are you talking about?

http://www.onlinetools.org/tools/easynav/cno/index.php

works without JavaScript and even makes sense without CSS... As it is
a PHP script.

-- 
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/



More information about the thelist mailing list