{% import _self as macros %}{{ macros.recursive_menu(pages) }}{% macro recursive_menu(pages) %}{% if current_route() starts with 'admin_' %}{% set subCategories = true %}{% else %} {% set subCategories = false %} {% endif %}{% import _self as macros %}{% if pages %}<ul class="dropdown-menu">{% for page in pages %}<li {% if page.children is defined and (page.children and subCategories) %}class="dropdown"{% endif %}><a href="{{ path('public_page', {url: page.node.url}) }}">{{- page.node.label -}}</a>{% if page.children is defined and subCategories %}{{ macros.recursive_menu(page.children) }}{% endif %}</li>{% endfor %}{% if current_route() == 'public_index' or current_route() == 'public_demande_form' or current_route() == 'public_categories' %}<li><a href="{{ path('public_categories') }}" class="text-orange">Voir tout</a></li>{% endif %}</ul>{% endif %}{% endmacro %}