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.

CommentFileSizeAuthor
#3 menu.png102.44 KBcaiobianchi

Comments

caiobianchi created an issue. See original summary.

davy-r’s picture

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

caiobianchi’s picture

StatusFileSize
new102.44 KB

Sure, 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)

Screenshot

berdir’s picture

Sounds 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

berdir’s picture

Priority: Major » Normal
Status: Active » Fixed

That's exactly what we did there, so you can now enable/disable active trail per menu.

Status: Fixed » Closed (fixed)

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