- Issue created by @svendecabooter
- 🇫🇷France G4MBINI Bègles
It should be related to https://www.drupal.org/project/ui_patterns/issues/3508748 ✨ Add ability to track active menu items in menu source Active
- 🇧🇪Belgium svendecabooter Gent
I applied the MR logic from ✨ Add ability to track active menu items in menu source Active .
Then inui_suite_daisyui:menu
component, I add a check:{% if item.in_active_trail %} <!-- Try adding extra class here --> {% endif %}
That doesn't seem to work... Maybe I'm missing some additional context
- 🇧🇪Belgium svendecabooter Gent
I fixed this by applying the patch in ✨ Add ability to track active menu items in menu source Active and adding the following to the
ui_suite_daisyui:menu
component:(...) {% for item in items %} <li{{ (not item.url and loop.first) ? ' class="menu-title"' : '' }}> {% set item_attributes = item.attributes|default(create_attribute()) %} {# Start adding class for menu active trail #} {% if item.in_active_trail %} {% set item_attributes = item_attributes.addClass('menu-active') %} {% endif %} {# End adding class for menu active trail #} {% if item.url %} (...)
Not sure if this logic can already be incorporated into ui_suite_daisyui, while waiting on its commit in ui_patterns.
It would be good to have this already in place by the time ui_patterns gets updated, but not sure what the policy is there... - 🇫🇷France G4MBINI Bègles
@svendecabooter thank you for your tests on these two related issues.
I would prefer to wait for UI Patterns upstream issue being fixed and move forward here.