Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
When i check "expand all" in block menu configuration, menu is still not expanded (boostrap theme).
Can you check that ?
Thanks a lot
Have a nice day
Comments
Comment #2
michelledarlingThe menu items in a submenu are there in the HTML after you check "expand all" but Bootstrap hides them with "display:none" until the parent item is clicked. To show them, just add this to your CSS for whichever menu you want to show opened by default.
Comment #3
devil2005 CreditAttribution: devil2005 commentedOh ok thanks, i thought it was in the module ;)
Comment #4
markdcIn case anybody else lands here, the solution is nicely explained in this video for D7: https://www.youtube.com/watch?v=6V4HmwQIT5g
For D8 he posted an explanation in the video description. I'll add it here since nothing on YouTube is forever.
STEPS (For DRUPAL 8):
``````````````````````````````````````````````````````````````````````
- Install and enable the Menu Block module
- Go to Block layout (Structure -} Block Layout), place a "Main navigation" block under "Primary" region
- Under "HTML AND STYLE OPTIONS" - "Theme hook suggestion", replace "main" with "menu_block" (though you can rename any name you like) and save blocks
- Go to \core\modules\system\templates\menu.html.twig and copy this file.
- Go to your sub theme and paste the file inside \templates folder
e.g themes\your_theme_name\templates\menu.html.twig.
- rename this twig file "menu" to "menu--menu_block" (Take note of the two Dashes and Underscore).
e.g themes\your_theme_name\templates\menu--menu_block.html.twig
- Flush caches and done!
Note:
-Basically what happen here is you create a new theme hook suggestion and override the menu.html.twig for menu block you created.
-You can reuse the same theme hook suggestion - "menu_block" as many as you like for other menu blocks you created. They will all pick up from the same "menu--menu_block.html.twig"