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

  • of the active primary_link, at least not as far as I can see. The "active "class is added to the current page link, but that doesn't do me much good from a styling perspective. With menu_tree_page_data, the active-trail is added, but of course I don't get the whole expanded tree then.

    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

    pcdonohue’s picture

    Apologies, the 2nd paragraph above got split because of my bad formatting, it was supposed to say

    the problem is that the "active-trail" class is not added to the <li> of the active primary link...

    ainigma32’s picture

    Status: Active » Postponed (maintainer needs more info)

    Couldn't you just combine the two (menu_tree_page_data and menu_tree_all_data) or determine the active trail yourself?

    - Arie

    ainigma32’s picture

    Status: Postponed (maintainer needs more info) » Fixed

    Looks 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

    Status: Fixed » Closed (fixed)

    Automatically closed -- issue fixed for two weeks with no activity.

    dynamind’s picture

    Title: no active-trail with menu_tree_all_data, alternatives? » Full menu tree with active trail
    Version: 6.2 » 6.10

    For 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.