{# Pages du premier niveau #}<div class="d-flex flex-middle flex-column flex-wrap blocnavLi"> {% for page in pages %} {# Si il n'y a pas de page parent, menu de premier niveau #} {% if page.pparent == 0 and page.pcacher_menu != 1 %} {% set hasChild = 0 %} {# Vérification si sous menu #} {% for pageSub in pages %} {% if pageSub.pparent == page.page_id and pageSub.pcacher_menu != 1 %} {% set hasChild = 1 %} {% endif %} {% endfor %} {% if hasChild %} <li data-id="{{ page.page_id }}" class="nav-item itemSousMenu dropdown m-0 p-0 col" style=""> {% set menu = page %} {% embed 'layouts/layouts_front/nav/nav_page_menu.html.twig' with {'level': 1} %}{% endembed %} {# Si il y a des sous menu niveau 1, on les affiche #} {% if hasChild == 1 %} <div class="dropdown-menu {% if logoInMenu == 'top_center' %}dropdown-menu-logo-top{% endif %}" aria-labelledby="dropdown-undefined"> <div class="dropdown"> {# Pages du sous menu niveau 1 #} {% for pageSub in pages %} {# Si la page parent correspond #} {% if pageSub.pparent == page.page_id and pageSub.pcacher_menu != 1 %} {% set hasChild = 0 %} {% for pageSubSub in pages %} {% if pageSubSub.pparent == pageSub.page_id and pageSubSub.pcacher_menu != 1 %} {% set hasChild = 1 %} {% endif %} {% endfor %} {% set menu = pageSub %} {% embed 'layouts/layouts_front/nav/nav_page_menu.html.twig' with {'level': 2} %}{% endembed %} {# Si il y a des sous menu niveau 2, on les affiche #} {# {% if hasChild == 1 %} #} {# <div class="dropdown-menu dropdown-submenu dropdown-submenu-level-3 {% if logoInMenu == 'top_center' %}dropdown-submenu-logo-top{% endif %}" #} {# aria-labelledby="dropdown-undefined"> #} {# #}{# Pages du sous menu niveau 2 #} {# {% for pageSubSub in pages %} #} {# #}{# Si la page parent correspond #} {# {% if pageSubSub.pparent == pageSub.page_id and pageSubSub.pcacher_menu != 1 %} #} {# {% set menu = pageSubSub %} #} {# {% set hasChild = 0 %} #} {# {% embed 'layouts/layouts_front/nav/nav_page_menu.html.twig' with {'level': 3} %}{% endembed %} #} {# {% endif %} #} {# {% endfor %} #} {# </div> #} {# {% endif %} #} {% endif %} {% endfor %} </div> </div> {% endif %} </li> {% endif %} {% endif %} {% endfor %}</div>