Menu / Dynamic menus
Note: You are currently reading the documentation for Bolt 4.0. Looking for the documentation for Bolt 5.2 instead?
Note: This feature is not yet implemented. If this is something you'd value, please upvote it here on our Ideas website.
You can use other menu.yaml
parameters to make a more dynamic menu. In this
example we will use taxonomies combined with the menu to create taxonomy-based
submenus. Let's say you want to have a few static pages to be listed as
submenus under "Pages" in your menu.
Start with creating a new taxonomy in taxonomy.yaml
to control what pages are
to be listed under "Pages":
Then, in your menu.yaml
change your "Pages" to the following.
Now all that's left is to modify your submenu template (_sub_menu.twig
) so that it adds the pages with the "pages" taxonomy.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.