Forum Moderators: coopster
This has been something that I can't figure out despite making a few sites using includes.
I want to give a list item (for general navigation) and active class when I am on that page. Because I use an include for my navigation to make life easier updating pages, I can't specify an active class for each list item that is active.
I've resorted to trying to read the url for the page name and using an if-else statement to display the class in the list item if the page name matches the link of the list item (does that make sense? i.e. if url is ...page1.php, then list item with page1.php in it displays an active class)
Is there a better way than this?
Cheers
At the moment, I'm just piecing together the knowledge I know and trying to be creative, but I'm sure there's a standard way out there of doing these types things...