svdb Posted March 25, 2010 Share Posted March 25, 2010 I'm building an website and I would like to include my menu, that is on all the pages, by using PHP. I've only one problem. When you're are on a page the menu item that linkes to that specific page has an different color.I now did this by giving the menu item a class="active". Can I include my menu with php and still be able to have these highlighted menuitems?thank you Link to comment Share on other sites More sharing options...
ShadowMage Posted March 25, 2010 Share Posted March 25, 2010 Yes, but you'll have to use a POST or GET variable (or maybe a session or cookie?) to determine what page you're on. Link to comment Share on other sites More sharing options...
knystrom18 Posted April 8, 2010 Share Posted April 8, 2010 MEGA BUMP!!!jkloth, when you say "use a POST or GET variable" I'm assuming that's something along the lines of having a code which gets the name of the page?Is it something relatively simple where somewhere in the page, you have a php code block which declares the name of the page, and then in the nav include file, you have another php code block that says get the names of these pages, and format the current page according to the stylesheet linked in the page?Thanks.EDIT: Scratch that, sorry for the bump. I've found a pure CSS solution. I'd be welcome to share if asked. It's quite ingenious actually... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.