0

I'm developing a custom theme using sub-theme just for learning purpose. In custom theme, I have added a custom block in which I need to display main menus' sub items if in_active_trail. I have already tried many times and wasted a lot time but unsuccessful.

  1. Block should display when Level 1 is in_active_trails and it has child(s).
  2. Block should not display when Level 1 in_active_trails but it has no child.
  3. If any Level 2 is current page, display Level 2 and 3 menu items expect level 1.
  4. Same as point 3, if Level 3 is current page then display level 3 and 2 items.

See attached image below for more understanding what I want to do.

Main Menu hierarchy

enter image description here

0

Here is the solution Menu Block. Install and configure it.

It works for me.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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