templates/bundles/SyliusShopBundle/Layout/TopMenu/_top_menu.html.twig line 1

Open in your IDE?
  1. {% for key, list in menu %}
  2.     {% if list is not empty %}
  3.         <div class="column">
  4.             <ul class="Layout_Topmenu">
  5.                 <li>
  6.                     <div class="Layout_Topmenu_title firstMenu">
  7.                         <span>
  8.                             {% if key == 'products' %}
  9.                                 Produits
  10.                             {% elseif key == 'commercial_agreements' %}
  11.                                 {% if list.url is defined and list.url is not empty %}
  12.                                     <a href="{{ list.url }}">Accords commerciaux</a>
  13.                                 {% else %}
  14.                                     Accords commerciaux
  15.                                 {% endif %}
  16.                             {% elseif key == 'partners' %}
  17.                                 {% if list.url is defined and list.url is not empty %}
  18.                                     <a href="{{ list.url }}">Partenaires / Innovation</a>
  19.                                 {% else %}
  20.                                     Partenaires / Innovation
  21.                                 {% endif %}
  22.                             {% endif %}
  23.                         </span>
  24.                         <button class="Layout_Topmenu--buttonMenu"></button>
  25.                     </div>
  26.                     <ul class="Layout_Topmenu--menu {% if key == 'partners' %} Layout_Topmenu--menu__partners {% endif %}">
  27.                         {% if key == 'products' %}
  28.                             {% for item in list %}
  29.                                 {% if item.parent == null %}
  30.                                     <li>
  31.                                         <a class="Layout_Topmenu_title" href="{{ path('sylius_shop_product_index', {'slug': item.slug, '_locale': item.translation.locale}) }}">{{ item.name }}</a>
  32.                                         <ul class="Layout_Topmenu--menu active" {{ sylius_test_html_attribute('vertical-menu') }}>
  33.                                             {% for child in item.children %}
  34.                                                 <li class="item">
  35.                                                     {% if child.slug is defined and child.slug is not empty %}
  36.                                                         <a href="{{ path('sylius_shop_product_index', {'slug': child.slug, '_locale': child.translation.locale}) }}">{{ child.name }}</a>
  37.                                                     {% else %}
  38.                                                         {{ child.name }}
  39.                                                     {% endif %}
  40.                                                 </li>
  41.                                             {% endfor %}
  42.                                         </ul>
  43.                                     </li>
  44.                                 {% endif %}
  45.                             {% endfor %}
  46.                         {% else %}
  47.                             {% for parent in list.parents %}
  48.                                 <li>
  49.                                     <div class="Layout_Topmenu_title">
  50.                                         {% if parent.url is defined and parent.url is not empty %}
  51.                                             <a href="{{ parent.url }}">{{ parent.name }}</a>
  52.                                         {% else %}
  53.                                             {{ parent.name }}
  54.                                         {% endif %}
  55.                                     </div>
  56.                                     {% if parent.children is defined %}
  57.                                         <ul class="Layout_Topmenu--menu active" {{ sylius_test_html_attribute('vertical-menu') }}>
  58.                                             {% for child in parent.children %}
  59.                                                 <li class="item">
  60.                                                     {% if child.url is defined and child.url is not empty %}
  61.                                                         <a href="{{ child.url }}"{{ sylius_test_html_attribute('vertical-menu-item') }}>
  62.                                                             {{ child.name }}
  63.                                                         </a>
  64.                                                     {% else %}
  65.                                                         {{ child.name }}
  66.                                                     {% endif %}
  67.                                                 </li>
  68.                                             {% endfor %}
  69.                                         </ul>
  70.                                     {% endif %}
  71.                                 </li>
  72.                             {% endfor %}
  73.                         {% endif %}
  74.                     </ul>
  75.                 </li>
  76.             </ul>
  77.         </div>
  78.     {% endif %}
  79. {% endfor %}