templates/Partial/categories_menu.html.twig line 1

Open in your IDE?
  1. {% import _self as macros %}
  2. {{ macros.recursive_menu(pages) }}
  3. {% macro recursive_menu(pages) %}
  4. {% if current_route() starts with 'admin_' %}
  5. {% set subCategories = true %}
  6. {% else %} {% set subCategories = false %} {% endif %}
  7. {% import _self as macros %}
  8. {% if pages %}
  9. <ul class="dropdown-menu">
  10. {% for page in pages %}
  11. <li {% if page.children is defined and (page.children and subCategories) %}class="dropdown"{% endif %}>
  12. <a href="{{ path('public_page', {url: page.node.url}) }}">
  13. {{- page.node.label -}}
  14. </a>
  15. {% if page.children is defined and subCategories %}
  16. {{ macros.recursive_menu(page.children) }}
  17. {% endif %}
  18. </li>
  19. {% endfor %}
  20. {% if current_route() == 'public_index' or current_route() == 'public_demande_form' or current_route() == 'public_categories' %}
  21. <li>
  22. <a href="{{ path('public_categories') }}" class="text-orange">
  23. Voir tout
  24. </a>
  25. </li>
  26. {% endif %}
  27. </ul>
  28. {% endif %}
  29. {% endmacro %}