Problems with menu - help
I'm facing a problem with a PHP based menu. When i click on the menu and one of its child i want i to stay open and not be closed. For example: Music>Dolly Parton.
Site URL: http://viktorflume.com/
easiest way is to use frames/iframes since it's just basic HTML. Though nothing is ever easy without a compromise in that search engines HATE frames and iframes!
The other way is to use AJAX, much more user friendly, but again, search engines won't find the content loaded by AJAX very easily.
In PHP, you just need to pass a value back to your menu object. COuld be done in various ways, either via URL or better still, via the session
Yeah, I'd go with the session option.
Then use that variable to open your nav menu to the correct section on page load.
$_SESSION['cur_nav_section'] = 'Music';
Just remember that search engines may not see the pages using sessions... since google bot for example doesn't just use ONE ip address and session to index a site
Yeah, I wouldn't suggest using sessions to build the menu ... just to "expand" the active menu section. I assume you use some JS to expand the sub-sections (IE: Music) when a user clicks on that section to expand it. I'd use sessions, or even the $_GET variable to keep track of the sub-section the user navigates to. So when the user goes to, say, Dolly Parton, you can use $_SESSION or $_GET to fire your JS that expands the Music section in the nav bar or whatever.
I think $_GET would be best for a persistant solution & use AJAX for a better user experience.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)