{% macro item(taxon, isChild) %}
{% import _self as macros %}
{% if taxon.children|length > 0 %}
<li class="{% if not isChild -%}navItem{% endif %}" {{ sylius_test_html_attribute('menu-item') }}>
<a class="navLink" href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}" title="{{ taxon.name }}" >
<span> {{ taxon.name }}</span>
</a>
<div class="subMenu">
<div class="sub-menu-top">
<div class="container px-0">
<div class="row align-items-lg-center">
<div class="ss-categ-l col-xl-10 col-lg-9 col-12">
<div class="flex-categ">
<div class="box-flex">
<div class="back_menu"><i class="icon-left-open"></i> {{'sylius.ui.return'|trans}}</div>
<div class="subBloc subBorder">
<div class="row no-gutters ">
<ul class="sub-product col-12 colum-count-menu">
{% for childTaxon in taxon.children %}
{% if childTaxon.enabled and childTaxon.visibleInMenu %}
<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>
{% endif %}
{% if childTaxon.children|length > 0 %}
{% for childTaxon in childTaxon.children %}
{% if childTaxon.enabled and childTaxon.visibleInMenu %}
<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>
{% endif %}
{% endfor %}
<li class="pb-lg-4 pb-3"></li>
{% endif %}
{% endfor %}
{% if taxon.enabled and taxon.visibleInMenu %}
<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>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="ss-categ-r col-xl-2 col-lg-3 col-12 d-lg-block d-none text-center">
{% if taxon.images|length > 1 %}
{% set path = taxon.images[1].path|imagine_filter(filter|default('app_shop_taxon_show_menu')) %}
{% else %}
{% set path = asset('images/imgsscateg.jpg') %}
{% endif %}
<img src="{{ path }}" alt="{{ taxon.name }}" class="" />
</div>
</div>
</div>
</div>
</div>
</li>
{% else %}
<li class="navItem">
<a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale, 'id': taxon.oldId}) }}"
class="navLink {% if not isChild -%}nav-item{% endif %}" {{ sylius_test_html_attribute('menu-item') }} title="{{ taxon.name }}"><span>{{ taxon.name }} </span>
</a>
</li>
{% endif %}
{% endmacro %}
{% import _self as macros %}
<ul class="onglets justify-content-md-center" id="mainNavbar">
{% if taxons|length > 0 %}
{% for taxon in taxons %}
{% if taxon.visibleInMenu == true %}
{{ macros.item(taxon) }}
{% endif %}
{% endfor %}
{% endif %}
</ul>