- Issue created by @pdureau
- Issue was unassigned.
- Status changed to Needs review
5 months ago 8:48am 20 January 2024 - π«π·France pdureau Paris
Hi Thomas,
If you are using the "Main Navigation" block from "Block layout" admin page (/admin/structure/block) you are in fact using this "presenter template" : menu--main.html.twig
{% if items %} {{ pattern('nav_menu', { 'menu_name': menu_name, 'html_id': 'navigation-main', 'items': items }) }} {% endif %}
So, the settings of the pattern are hardcoded in this file and are not available from backoffice.
2 proposals
From backoffice
Because you are using the development version of ui_suite_dsfr, the menu items are already available as a configurable setting.
So you can use this little module https://www.drupal.org/project/ui_patterns_pattern_block β to place a block, pick the
nav_menu
component, and configure it.However, as you can see, this module is not actively maintained, and will be rewritten and merged into the upcoming UI Patterns 2.x. So it may be a bit risky to use it.
From Twig code
Instead of modifying pattern-nav-menu.html.twig file, you can modify menu--main.html.twig. It is cleaner this way.
I recommend not doing the change directly in your local ui_suite_dsfr, but in a sub-theme.
- Status changed to Closed: won't fix
5 months ago 5:28pm 20 January 2024