Keeping Navigation Current With PHP: A List Apart
Posted Friday, November 7th, 2003 at 12:43 pm
It gives me great pleasure to report that A List Apart accepted and published an article of mine. For the next week, my article appears on the front page of their site.
A List Apart Magazine (ISSN: 1534-0295) explores the design, development, and meaning of web content, with a special focus on techniques and benefits of designing with web standards. I’ve learned so much from them over the years and wanted to give a little back.
So I submitted an article on how to use PHP and CSS to keep track of your current page in navigational menus. Here it is:
Keeping Navigation Current With PHP: A List Apart
by Jason PearceTurning unordered lists into elegant navigational menus has become the new favorite pastime for many web developers. Adding a unique id or class attribute to indicate which menu item reflects a user’s current page, however, can become laborious. Even if you use body id attributes instead, as ALA does, some labor is involved and it is easy to make mistakes. But thanks to PHP, we can add these current-page indicators automatically.” …more
Thanks ALA for the years of ideas, tutorials, and articles.
Tuesday, December 11th, 2007 at 8:45 am
Jason
I came across your excellent article on ALA however I am struggling to get this to work and I was hoping you could help a relative newbie?!
I have created a website using Christopher Robbins’ tutorial called ‘Manage Your Content With PHP’. This uses a PHP template file that includes different html files for content. What I would like is that the navigation menu highlights which page is currently active, however, how does your system work when the included individual pages that contain the variable $thisPage=”xxxx” are html? Surely they need to be PHP files??
Any help would be much appreciated.
Thanks in advance