templates/frontend/fullmenu.html.twig line 1

Open in your IDE?
  1. <div class="row" style="margin-top: 70px;background-color: white;z-index:100; position: fixed; width:100%;">
  2.     <!-- Menu principale-->
  3.     <nav class="navbar header-menu-main full-width d-none d-xl-block  d-lg-block">
  4.         <ul class="nav nav-justified group">
  5.            {% for menu in global.menu %}
  6.                 <!-- Menu principale À BOIRE-->
  7.                 <li class="nav-item dropdown underline-effect-wrapper">
  8.                     <a class="nav-link underline-effect underline-effect-black underline-effect-h2 allowClick"
  9.                        data-toggle="dropdown" href="#" role="button"
  10.                                                        aria-haspopup="true"
  11.                                                        aria-expanded="false">{{menu.name |upper}}</a>
  12.                     <!-- Menu principale dropdown-menu-->
  13.                     <div class="dropdown-menu">
  14.                         <div class="sous-menu row">
  15.                             <div class="sous-menu-main">
  16.                                 <ul class="sous-menu-main-items" style="margin-bottom:75px">
  17.                                     <li class="alllistsMenu" >
  18.                                         <a class=" allowClick allProductsMenuitems" style="color:black !important;" href="{{path("viewCategory", {"name": menu.UrlName})}}">Tous les produits {{menu.name |capitalize }}</a>
  19.                                     </li>
  20.                                     {% for submenu in menu.categories %}
  21.                                     {% if submenu.placement > 0 %}
  22.                                         <li class="sous-menu-main-item" {% if loop.first %}active default{% endif %}>
  23.                                             <a class="sous-menu-main-item-title allowClick" href="{{path("viewCategory", {"name": menu.UrlName, 'sub1':submenu.UrlName})}}">{{submenu.name}}
  24.                                                 <span class="fa fa-chevron-right " aria-hidden="true" style="float: right;"></span></a>
  25.                                             <div class="sous-submenu">
  26.                                                 <div class="row">
  27.                                                     {# This is bad, but we calculate the amount of children to every menu to devide by columns #}
  28.                                                     {% set amountPerCol = submenu.categories | length %}
  29.                                                     {% set amountPerCol = amountPerCol / 2 %}
  30.                                                     {% set amountPerCol = amountPerCol | round(0, 'ceil') %}
  31.                                                     {# End calculation amount per columns we can display #}
  32.                                                     {# Turn false once on the second row #}
  33.                                                     {% set firstRow = true %}
  34.                                                     {# we use col to know where we are at in the loop, increase to all menu or submenu #}
  35.                                                     {% set col = 1 %}
  36.                                                     <div class="col-3" style="padding-left:5px">
  37.                                                         <ul >
  38.                                                             {% for subsubmenu in submenu.categories %}
  39.                                                               {% if global.hasProducts(subsubmenu) %}
  40.                                                                 {% if col > amountPerCol and firstRow%}
  41.                                                                     {% set firstRow = false %}
  42.                                                         </ul>
  43.                                                     </div>
  44.                                                     <div class="col-3">
  45.                                                         <ul>
  46.                                                                 {% endif %}
  47.                                                                 {% if (subsubmenu.placement > 0) %}
  48.                                                                 <li class="caption underline-effect-wrapper-l2">
  49.                                                                     <a class="underline-effect-l2 allowClick underline-effect-black underline-effect-h1"
  50.                                                                        href="{{path("viewCategory", {"name": menu.UrlName, 'sub1':submenu.UrlName, 'sub2': subsubmenu.UrlName})}}">{{subsubmenu.name}}</a>
  51.                                                                 </li>
  52.                                                                  {% endif %}
  53.                                                                 {% for endmenu in subsubmenu.categories %}
  54.                                                                   {% if global.hasProducts(endmenu)  %}
  55.                                                                     {% if (endmenu.placement > 0)  %}
  56.                                                                     <li class="underline-effect-wrapper-l2">
  57.                                                                         <a class="underline-effect-l2 allowClick underline-effect-gray underline-effect-h1"
  58.                                                                            href="{{path("viewCategory", {"name": menu.UrlName, 'sub1':submenu.UrlName, 'sub2': subsubmenu.UrlName, 'sub3': endmenu.UrlName})}}">{{endmenu.name}}</a>
  59.                                                                     </li>
  60.                                                                     {% set col = col + 1 %}
  61.                                                                     {% endif %}
  62.                                                                   {% endif %}
  63.                                                                 {% endfor %}
  64.                                                                 {% set col = col + 1 %}
  65.                                                               {% endif %}
  66.                                                             {% endfor %}
  67.                                                             {# In case we arrived a same amount of items #}
  68.                                                             {% if col <= amountPerCol or firstRow%}
  69.                                                                 </ul>
  70.                                                     </div>
  71.                                                     <div class="col-3">
  72.                                                         <ul>
  73.                                                             {% endif %}
  74.                                                         </ul>
  75.                                                     </div>
  76.                                                 </div>
  77.                                             </div>
  78.                                         </li>
  79.                                          {% endif %}
  80.                                     {% endfor %}
  81.                                 </ul>
  82.                             </div>
  83.                         </div>
  84.                     </div>
  85.                     <!-- Menu principale dropdown-menu-->
  86.                 </li>
  87.             {% endfor %}
  88.              <li class="nav-item dropdown underline-effect-wrapper">
  89.                     <a class="nav-link underline-effect underline-effect-black underline-effect-h2 allowClick" href={{path('viewSponsoredCategory')}}>SOLDES</a>
  90.                     <!-- Menu principale dropdown-menu-->
  91.             </li>
  92.         </ul>
  93.     </nav>
  94.     <!-- Menu principale-->
  95. </div>