{% 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}) }}" >
{{ taxon.name }} <span>({{ taxon|app_get_product_amount(sylius.localeCode, sylius.channel ) }})</span>
</a>
<div class="subMenu" style="display: none;">
<div class="sub-menu-top">
<div class="container">
<div class="row align-items-center">
<div class="ss-categ-l">
<div class="flex-categ">
<div class="box-flex">
<div class="subBloc subBorder">
<div class="sub-lib"><span> {{ taxon.name }} </span><a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}">{{'app.header.voir_tout'|trans}}</a></div>
<div class="descr-categ-onglet descr-categ">
<p>{{ taxon.description }}</p>
</div>
<div class="row">
<div class="col-12">
<ul class="sub-product">
{% for childTaxon in taxon.children %}
{{ macros.item(childTaxon, true) }}
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="s-categ-r">
<div class="r-ss-img pl-1 text-right">
<div class="img-ssm-bit">
{% if taxon.images.first %}
{% set path = taxon.images.first.path|imagine_filter(filter|default('sylius_admin_product_large_thumbnail')) %}
{% else %}
{% set path = '//placehold.it/200x200' %}
{% endif %}
<img src="{{ path }}" alt="{{ taxon.name }}" class="ui bordered image" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
{% else %}
<li class="navItem">
<a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}"
class="navLink {% if not isChild -%}nav-item{% endif %}" {{ sylius_test_html_attribute('menu-item') }}>{{ taxon.name }} <span>({{ taxon|app_get_product_amount(sylius.localeCode, sylius.channel ) }})</span>
</a>
</li>
{% endif %}
{% endmacro %}
{% import _self as macros %}
{% if taxons|length > 0 %}
<ul class="onglets" id="mainNavbar">
{% for taxon in taxons %}
{{ macros.item(taxon) }}
{% endfor %}
<li class="navItem"><a href="{{ path('app_shop_brand_index') }}" class="navLink " title="{{ 'app.ui.brands'|trans }}">{{ 'app.ui.brands'|trans }}</a> </li>
<li class="navItem visible-980">
<a href="#" class="navLink rech-link" > {{'sylius.ui.search' |trans}}</a>
</li>
</ul>
{% endif %}