I have a custom menu that is several levels deep. I am trying to trigger a context when the user visits a certain top-level page or any page beneath it on the menu. Based on the description of the menu condition, it sounds like I should just be able to select the top level and as long as it is in the active trail, the context should still trigger. Currently, it only triggers the context for the top level page and only triggers for ones beneath it if I explicitly select each one. How can I trigger a context for an item and everything beneath it on a custom menu?

More information: I'm aware of the various limitations of Drupal's menu system, especially with regard to the active trail. The items I'm trying to trigger the context for only exist in this menu and I'm using the Menu Blocks module which fixes the active trail for the custom menu (it shows up properly if I call 'menu_get_active_trail()').

Comments

jhaskins’s picture

Just a quick update for anyone interested: it turns out this was the result of using another module (Menu Firstchild) in conjunction with the menu condition. To work around it, simply select the first child of the menu item you want to trigger the context. I'm going to take a stab at a proper fix & if I succeed, I'll post the result here for anyone interested.

dellis’s picture

This would be awesome--I was really getting frustrated with the "menu condition" option in context because no matter what I did the default pointed to the first menu item which had a submenu. Since both of the menu items I've been testing with have "" as their root link, this must be the explanation.

I would definitely be interested in seeing code that might clear this up!!

dellis’s picture

any updates?