themes/BootstrapTheme/templates/bundles/SyliusShopBundle/Taxon/_horizontalMenu.html.twig line 1

Open in your IDE?
  1. {% macro item(taxon, isChild) %}
  2.     {% import _self as macros %}
  3.     {% if taxon.children|length > 0 %}
  4.         <li class="{% if not isChild -%}navItem{% endif %}" {{ sylius_test_html_attribute('menu-item') }}>
  5.             <a class="navLink" href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}" title="{{ taxon.name }}" >
  6.                 <span>  {{ taxon.name }}</span>
  7.             </a>
  8.             <div class="subMenu">
  9.                 <div class="sub-menu-top">
  10.                     <div class="container px-0">
  11.                         <div class="row align-items-lg-center">
  12.                            <div class="ss-categ-l col-xl-10 col-lg-9 col-12">
  13.                                 <div class="flex-categ">
  14.                                     <div class="box-flex">
  15.                                         <div class="back_menu"><i class="icon-left-open"></i> {{'sylius.ui.return'|trans}}</div>
  16.                                         <div class="subBloc subBorder">
  17.                                             <div class="row no-gutters ">
  18.                                                 <ul class="sub-product col-12 colum-count-menu">
  19.                                                     {% for childTaxon in taxon.children %}
  20.                                                         {% if childTaxon.enabled and childTaxon.visibleInMenu %}
  21.                                                             <li class=""> <a class="" href="{{ path('sylius_shop_product_index', {'slug': childTaxon.slug, '_locale': childTaxon.translation.locale, 'id': childTaxon.oldId}) }}" title="{{ childTaxon.name }}"><span class="fontsize-normal font-pro-bold text-uppercase"> {{ childTaxon.name }}</span></a></li>
  22.                                                         {% endif %}
  23.                                                         {% if childTaxon.children|length > 0 %}
  24.                                                             {% for childTaxon in childTaxon.children %}
  25.                                                                 {% if childTaxon.enabled and childTaxon.visibleInMenu %}
  26.                                                                     <li> <a class="" href="{{ path('sylius_shop_product_index', {'slug': childTaxon.slug, '_locale': childTaxon.translation.locale, 'id': childTaxon.oldId}) }}" title="{{ childTaxon.name }}">{{ childTaxon.name }}</a></li>
  27.                                                                 {% endif %}
  28.                                                             {% endfor %}
  29.                                                             <li class="pb-lg-4 pb-3"></li>
  30.                                                         {% endif %}
  31.                                                     {% endfor %}
  32.                                                     {% if taxon.enabled and taxon.visibleInMenu %}
  33.                                                         <li class="d-block d-lg-none"><a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}" title="{{'app.header.voir_tout'|trans}}"class="text-underline font-pro-bold color-pink-s text-capitalize"><i class="icon-eye"></i> {{'app.header.voir_tout'|trans}}</a></li>
  34.                                                     {% endif %}
  35.                                                  </ul>
  36.                                             </div>
  37.                                         </div>
  38.                                     </div>
  39.                                 </div>
  40.                             </div>
  41.                             <div class="ss-categ-r col-xl-2 col-lg-3 col-12 d-lg-block d-none text-center">
  42.                                 {% if taxon.images|length > 1 %}
  43.                                     {% set path = taxon.images[1].path|imagine_filter(filter|default('app_shop_taxon_show_menu')) %}
  44.                                 {% else %}
  45.                                     {% set path = asset('images/imgsscateg.jpg') %}
  46.                                 {% endif %}
  47.                                 <img src="{{ path }}" alt="{{ taxon.name }}" class="" />
  48.                             </div>
  49.                         </div>
  50.                     </div>
  51.                 </div>
  52.             </div>
  53.         </li>
  54.     {% else %}
  55.         <li class="navItem">
  56.             <a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}"
  57.                 class="navLink {% if not isChild -%}nav-item{% endif %}" {{ sylius_test_html_attribute('menu-item') }}  title="{{ taxon.name }}"><span>{{ taxon.name }} </span>
  58.             </a>
  59.         </li>
  60.     {% endif %}
  61. {% endmacro %}
  62. {% import _self as macros %}
  63. <ul class="onglets justify-content-md-center" id="mainNavbar">
  64.     {% if taxons|length > 0 %}
  65.         {% for taxon in taxons %}
  66.             {% if  taxon.visibleInMenu == true %}
  67.                 {{ macros.item(taxon) }}
  68.             {% endif %}
  69.         {% endfor %}
  70.     {% endif %}
  71. </ul>