templates/themes/theme/common/menu.html.twig line 1

Open in your IDE?
  1. {% set child = child ?? false %}
  2. <ul class="{{ child ? 'site-header__menu site-header__menu--child' : 'site-header__menu' }}">
  3. {% for item in menu %}
  4. <li>
  5. <a
  6. href="{{ item.slug }}"
  7. class="{{ item.slug == currentUrl ? 'active' : '' }}"
  8. {% if item.new_window %}
  9. target="_blank"
  10. {% endif %}
  11. >
  12. {{- item.navtitle -}}
  13. </a>
  14. {% if item.children is defined and item.children|length > 0 %}
  15. {% include "@theme/common/menu.html.twig" with { 'menu' : item.children, 'currentUrl' : currentUrl, 'child' : true } only %}
  16. {% endif %}
  17. {% if item.isdynamic and item.dynamic_items|length > 0 %}
  18. <ul>
  19. {% for item in item.dynamic_items %}
  20. <li>
  21. <a href="{{ item.slug }}">{{ item.navtitle }}</a>
  22. </li>
  23. {% endfor %}
  24. </ul>
  25. {% endif %}
  26. </li>
  27. {% endfor %}
  28. </ul>