Hello...

I was trying to get a context to trigger an active menu trail that is 2 levels deep. Is this not possible? I have a menu item as such:

About us -> Blog -> [blog entries]

I created a context for node type of blog, and added in a breadcrumb reaction and the menu reaction to set the active trail to Blog. Doesn't work.... but then I saw the README file describing that issue.

Just confirming that this is indeed not possible?

Thanks

Comments

Mark Trapp’s picture

You should be able to trigger an active menu trail 2 levels deep as long as Expand all children of this tree is checked. Does that not work for you?

If you're trying to do it without it checked, it is indeed not possible: the child menus aren't populated unless the parent menu is expanded so there's no way to traverse the menu tree.

bkosborne’s picture

Status: Active » Closed (works as designed)

Ahh makes sense ... Yeah I don't have that set unfortunately. I was hoping that the context would be savvy enough to expand the tree out to where I want the active trail to be, you know?

Oh well, hopefully the client doesn't complain.

safetypin’s picture

@bkosborne, I was able to work around this problem by creating a unique menu block that was configured to "expand all children" that only displayed in the necessary "section". So, throughout most of the site, one menu_block was being shows that was not configured to expand all children, but in the sections where I needed to use contexts to trigger the menu, I had a different menu_block that was.

bkosborne’s picture

Yeah I believe that's how I went around the problem as well. It's messy, but seems to be the best solution available.

bkosborne’s picture

I revist this after I saw a screencast by Node One on doing this using Rules and a couple other modules in D7. That screencast is here: http://nodeone.se/blogg/using-rules-to-set-active-menu-items

However, I'm working on a D6 build that again requires this functionality. I haven't tried it yet, but the features of this module claim to provide a work around for this very common problem people run into. I'll post back on my findings...
http://drupal.org/project/menutrails

Alice Heaton’s picture

As this is still an issue in Drupal 7, I thought I would point out that there is an easier work around: if you don't mind your menus actually being loaded, then you can simply hide the non active ones using CSS.

Something like this :

/* Hide all menus of level > 1 */
div.block-menu-block li ul {
  display: none;
}
/* Display the child items of menus in the active trail */
div.block-menu-block li.active-trail ul {
  display: block;
}

This works well for two levels. You'll need to add more rules if you have more levels.