0

I created some menus under 'Main Navigation' and assigned into the side bar region. I selected the depth level starting from 2 to 4.(See the screenshot)

The menu block is not showing for dynamically created routing(multiple routing) pages but for normal pages like node is showing fine.

Screenshot: enter image description here

6
  • Are the dynamic pages linked in the menu at level 2 or below?
    – Clive
    Jul 21 '20 at 18:36
  • No it's not linked because those are N number of routing.. but I have one menu (/page/aaa/) partially matching to the dynamic routings. Ex: /page/aaa/test /page/aaa/test/test1 /page/aaa/test2/test3 etc.
    – Manikandan
    Jul 21 '20 at 18:55
  • 1
    See the description text immediately under the Initial visibility level input - unless the current page has an associated menu item, the menu won't show. If you want the menu to start at level 2, it needs some way to identify which level 2 items to display, and it gets that through the menu parentage
    – Clive
    Jul 21 '20 at 19:05
  • Ohh... Thank You so much. The eventual option is have to load menus programmatically using the \Drupal::menuTree(); However just I would like to ask you, is there any tricks to set the current path as (/page/aaa) whenever accessing the dynamic routings.
    – Manikandan
    Jul 21 '20 at 19:30
  • 1
    I'm sure there's probably somewhere you could hook into (I don't know it off the top of my head), but as an alternative are you aware of the Menu block module? I think it does what you're looking for right out of the box. You can start a menu in a block at level 2, and specify which parent it should use, then use the block visibility settings to keep it on /page/aaa/* or whatever suits
    – Clive
    Jul 21 '20 at 21:55

Your Answer

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

Browse other questions tagged or ask your own question.