1

So it looks like drupal menus only have a active trail depth of one, which is problematic for my nested pages since my menus wont be marked active once I drill into the nest. Is there a module or setting to fix this?

What I mean is if I have the following pages:

about/board-directors/john-smith

and a menu that shows:

  • about
  • board of directors
  • something else

I could be on "about" and the about link would be active. I could be on "about/board-directors" and 'board of directors' would be active. But If Im on the page "about/board-directors/john-smith" I would like the 'board of directors' menu item to be active. How can I accomplish that? Im a bit of a noob so I'm in the dark here.

2 Answers 2

2

The Menu Trail By Path module will accomplish this:

Menu Trail By Path sets the active-trail on menu items according to the current url.

For example if you are at yoursite.com/blog/category1/article1 Menu
Items with these paths will get the active-trail class on them and expand accordingly.

blog
blog/category1
blog/category1/article1

0

I think that Menu block will answer your requirements, check it out. Here is a quote about it (from the module's project page):

... have you ever used the Main and Secondary menu links feature on your theme and wondered “how the hell do I display any menu items deeper than that?”

Well, that’s what this module does. It provides configurable blocks of menu trees starting with any level of any menu. And more!

So if you’re only using your theme’s Main menu links feature, you can add and configure a “Main menu (levels 2+)” block. That block would appear once you were on one of the Main menu’s pages and would show the menu tree for the 2nd level (and deeper) of your Main menu and would expand as you traversed down the tree. You can also limit the depth of the menu’s tree (e.g. “Main menu (levels 2-3)”) and/or expand all the child sub-menus (e.g. “Main menu (expanded levels 2+)”).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.