I’m convinced there should be a simple way to code this, but I can’t figure it out. (I remember that even MS Frontpage could do this many years ago)
It seems to me that there should be a way to use something like $_SERVER[‘REQUEST_URI’] as each page loads, compare it to the menu items, and modify the current page menu item link.
Thanks for your replies and suggestions. I’ve looked at them all and in the end came up with a hybrid solution based partly on gandalf458’s approach and the menu setup used by coothead which I found by following the link suggested by SamA74. Because I use folders I ran into some issues that don’t turn up if everything is in one folder.
I placed the following in my common header, called by all pages: $page = basename($_SERVER['PHP_SELF']);
Here are a few lines from my main menu which is in a php file called by all pages:
The menu php file contains two menus - one is site-wide, the one below it contains links to the “home” page in each folder. I had to give each “home” page a unique name, however. It works fine, although I had to go for absolute links in the site-wide menu (which is OK because they will hardly ever change).
So, thanks to you I’ve learned a lot, and have solved my problem.