How to Create a Menu Block in Drupal 8
In Drupal 7, you could do this by using the Menu block module or by using a theme that had added support for more complex menus.
However, in Drupal 8, the Menu block module has been moved to the core. Here’s how it works …
- In Drupal 8, go to Structure > Block layout.
- Select “Place block”.
- Scroll down till you find “Main Navigation” or the menu you want to use and select “Place block”.
Here you can decide if you want the title of the block to be on display and set the visability options for the block.
Note that you must choose which content types this will be displayed on if you do not tick any of these content types the menu will not appear.
- Select “Menu Levels” and choose the level of menu you want to be displayed on this site.
Now you should see the menu displayed in the sidebar region of your Drupal site on all of your basic pages.
Major feature Menu Blocks has is setting up a Parent item for a menu block, where show above example doesn’t have it. Any insights of how this can be approached in D8?
hi there, i have one scenario where i need to filter menus on the basis of drop down selection. Foe ex. i have 5 menus menu1, menu2, menu3, menu4, menu5 and one dropdown with value IT and HR. the menu 4 will be changed according the dropdown value, if i select IT then menu 4 should be changed to IT similar for HR and if none select menu 4 will be dispalyed. Is it possible?
You can assign specific menus to pages by restricting the pages it appears on.
The only problem is when there are no secundary links, the menublock is still rendered. So the sidebar region is showing but empty. Does anyone know how to not render the sidebar if there are no links in the menublock?