I could use a few pointers.
I'm trying to implement a css style primary navigation menu with submenus that will appear horizontally when the primary link is hovered, ala http://www.alistapart.com/articles/hybrid
Which means I need the full primary menu tree printed out, not just the top-level with the active link menu expanded. I've tried using menu_tree_all_data, passing the resulting tree to menu_tree_output... the problem is that the "active-trail" class is not added to the
I can see that the intended behavior for menu_tree_all_data might be not to have any active-trail, but is there any way I can print out a whole expanded tree, with the active trail set? Or am I barking up the wrong tree?
thanks,
Patrick
Comments
Comment #1
pcdonohue commentedApologies, the 2nd paragraph above got split because of my bad formatting, it was supposed to say
Comment #2
ainigma32 commentedCouldn't you just combine the two (menu_tree_page_data and menu_tree_all_data) or determine the active trail yourself?
- Arie
Comment #3
ainigma32 commentedLooks like pcdonohue won't be posting any feedback so I'm setting this to fixed.
Feel free to reopen if you think that is wrong.
- Arie
Comment #5
dynamind commentedFor all those who Googled their way here, I think this addresses the issue: http://www.touchdesk.nl/2009/04/full-menu-tree-with-active-trail-in-drup...
By tweaking menu_tree() a little bit and adding a recursive function that finds the active trail, we get a menu tree that correctly labels LI.in-active-trail or LI.active, in stead of just using LI.expanded and A.active.
I tried to reuse as much of Drupal in the solution above as possible; I hope this helps.