I love the work that's been done on DHTML menu but there's one feature that would make it perfect for me. I've edited the .js file to expand onmouseover which is working great. My only problem is that I want the active trail to always stay open.
Basically, I'd like the user to always be able to see where they are in the menu but still be able to hover over other other menu items and see what is in other sections.
I have "Keep only one menu open at a time" and I'd like for this feature to still work with the exception of the active trail. Really, I want two menus open at a time -- whatever the user is hovering over and the active trail.
I hope I've explained what I'm looking for correctly. I did a thorough search in the forum but couldn't find anything about a similar case.
If anyone has a solution or an alternative to DHTML Menu which will do what I'm asking, I'd much appreciate it.
Thanks!
Comments
Comment #1
billychan commentedbump and subscribe.
Comment #2
BigMike commentedHelloStephanie,
Any progress on this? I modified Nice Menu to do this, but I've since upgraded to DHTML Menu and need to keep the active menu open as well...
Comment #3
sumaiyajaved commentedsome problem .. any progress?
Comment #4
stephaniefuda commentedI'd also love to have this function
Comment #5
alexhelkar commented+1
Comment #6
BigMike commentedOk guys,
I last looked into this when I posted above in 2010, and yesterday I got caught up on many projects and decided I'd check in on this. Two years have passed and I couldn't find a solution, so I decided to tackle this myself. I've learned a lot of PHP since 2010, and I got this functionality to work. This is for v6-3.5.
I added descriptions to explain what is going on. Please let me know if you have any questions. My site uses a menu structure of one parent and only one child (or leaf), but it should work with menus of any depth so long as the menu URL structure is preserved with each successive level.
File: dhtml_menu.module
After line 112,
Add the following:
And also, 12 lines down you're find this, originally line 125:
if ($menu && !($in_active_trail || in_array(substr($item['options']['attributes']['id'], 5), $cookie))) {Replace it with this:
The active menu should now remain open, and you'll have the CSS class of "TRAIL" for both levels so you can add styling to either the parent, the child, or both.
A few notes:
-- Because this is comparing Menu URLs against the current URL, your menu's must ultimately have a path that is structured the same as the Current URL being viewed. If this affects you, I suggest using the URL Alias module to change your menu paths to have the proper destination/intended path.
-- If your menus do not have unique path structures (ie. if they overlap), then multiple menus will remain open. This occurs because I built this script to prevent the collapse of _any_ Parent who's Menu URL is found anywhere within the Current URL.
I have this working on my Drupal + Ubercart Product website located here:
http://www.marlincrawler.com
Please let me know if you have any questions!
Regards,
BigMike
Comment #7
vuilI closed the issue as Closed (outdated) because it is for unsupported 6.x version of Drupal.
Thanks for your time to working on and the contribution!