I had a thought and wanted to pass it by my pears before I spend hrs coding this up.
I have a php include file that contains the master nav.
The master nav is made up with ID’d div’s
On each page the php is included has a javascript that runs a “getbyid” and collapse the div id that contains the page link that you are on and expands an already hidden div that contains a “active/highlighted” icon/text that indicates what page you are on.
This way you have the joys of a master php nav, easy to edit and yet dynamic and user friendly.
How does this method sound to anyone else?
As I am typing this I know this will not always work if JS is disabled or not installed. Could this function be accomplished through php alone.
Thank you in advance for any ideas or additions you care to make.
Get a couple of pages working in straight HTML and JS first, identify the bit that changes between those 2 pages, and then get PHP to output that change.
IF these pages are also expected to send GET or POST calls which PHP is supposed to act upon, then it is doubly important to make sure you have got code which basically works before bringing PHP into the mix.
Also, to avoid other annoying errors make sure each ID on each page is unique.
Hope these hints from one of your peers save you a bit of sanity. 🙂