Hey guys,
When I’m displaying 2 diff menus on the same page, but one of them should not load if there’s no children, still gets loaded because menu_trail_by_path provides access to the parent menu via path. Is there a way to override this behaviour for this one menu?
I have tried the following:
- Setting different starting levels for my menu blocks.
- Hiding based on a path
- Using a hook to override the active trail (But I maybe using the wrong one)
Any help would be appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | menu.png | 102.44 KB | caiobianchi |
Comments
Comment #2
davy-r commentedHi Caiobianchi,
Could you try to explain, with a example, what you mean with "but one of them should not load if there’s no children, still gets loaded because menu_trail_by_path provides access to the parent menu via path.". I don't understand what you are trying to accomplish.
Comment #3
caiobianchi commentedSure, davy-r
Essentially, I have 2 menu blocks that are totally unrelated. The Main Menu and a Section Menu. I want Menu Trail By Path to work on the Main Menu, but I want to keep the default Drupal behaviour for the Section Menu (in other words, I want to be able to set the active trail to the current node)
(Wireframe attached)
Comment #4
berdirSounds like this might be possible with #2867366: Allow to configure max path parts and relevant menus to optimize performance, assuming we don't just make the setting there an on/off switch but multiple options like Off | By Trail | Default behavior
Comment #5
berdirThat's exactly what we did there, so you can now enable/disable active trail per menu.