{% macro item(taxon, isChild) %}
{% import _self as macros %}
{% if taxon.getEnabledChildren|length > 0 %}
<li class="{% if not isChild -%}navItem{% endif %} {% if app.request.query.get('slugTaxon') == ('/cat-' ~ taxon.translation.slug ~ '.html') or app.request.query.get('slugTaxon') == ('/cat-' ~ taxon.translation.slug ~ '.htm') %}active {% endif %}" {{ sylius_test_html_attribute('menu-item') }} id="categ-{{taxon.id}}">
<a class="navLink d-flex align-items-center" href="{{ path('monsieurbiz_sylius_search_taxon', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" title="{{ taxon.name }}">
{% if taxon.getImagesByType('icon_menu')|length > 0 %}
{% set path = taxon.getImagesByType('icon_menu')[1].path|imagine_filter(filter|default('app_shop_taxon_icon')) %}
{% else %}
{% set path = asset('images/ico_categ1.svg')%}
{% endif %}
<strong>
<img src="{{path}}" class="{{ taxon.name }}">
</strong>
<span class="pl-2"> {{ taxon.name }}
<i class="icon-down-open-big"></i>
</span>
</a>
{% set openMenu = false %}
{% if app.request.query.get('slugTaxon') == ('/cat-' ~ taxon.translation.slug ~ '.html') or app.request.query.get('slugTaxon') == ('/cat-' ~ taxon.translation.slug ~ '.htm') %}
{% set openMenu = true %}
{% else %}
{% for childTaxon in taxon.getEnabledChildren %}
{% if app.request.query.get('slugTaxon') == ('/cat-' ~ childTaxon.translation.slug ~ '.htm') %}
{% set openMenu = true %}
{% endif %}
{% endfor %}
{% endif %}
<div class="subMenu {% if openMenu %} open-menu{% endif %}">
<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="row">
<div class="col-12">
<ul class="sub-product">
<li class="list-styled-none"><a href="{{ path('monsieurbiz_sylius_search_taxon', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="navLink d-flex align-items-center color-pink-s text-underline"><i class="icon-right-open"></i> {{'app.header.see_all_product'|trans}} </a></li>
{% for childTaxon in taxon.getEnabledChildren %}
<li id="sscateg_{{childTaxon.id}}" {% if app.request.query.get('slugTaxon') == (childTaxon.translation.slug ~ '.html') %}class="active"{% endif %}>
<a class="navLink d-flex align-items-center {% if app.request.query.get('slugTaxon') == ('/cat-' ~ childTaxon.translation.slug ~ '.htm') %} color-pink-s {% endif %}" href="{{ path('monsieurbiz_sylius_search_taxon', {'slug': childTaxon.slug, '_locale': childTaxon.translation.locale}) }} " title="{{ childTaxon.name }}">{{ childTaxon.name }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
{% else %}
<li class="navItem test3" id="categ-{{taxon.id}}">
<a href="{{ path('monsieurbiz_sylius_search_taxon', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}"
class="navLink d-flex align-items-center {% if not isChild -%}nav-item{% endif %}"
title="{{ taxon.name }}" {{ sylius_test_html_attribute('menu-item') }}>
{% if taxon.getImagesByType('icon_menu')|length > 0 %}
{% set path = taxon.getImagesByType('icon_menu')[1].path|imagine_filter(filter|default('app_shop_taxon_icon')) %}
{% else %}
{% set path = asset('images/ico_categ1.svg')%}
{% endif %}
<strong>
<img src="{{path}}" class="{{ taxon.name }}">
</strong>
<span class="pl-2">{{ taxon.name }}</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 color-red" title="{{ 'app.ui.brands'|trans }}">{{ 'app.ui.brands'|trans }}</a> </li>
<li class="navItem"><a href="{{ path('sylius_shop_product_index', {'slug': 'nouveautes'}) }}" class="navLink color-red" title="{{ 'app.ui.news'|trans }}">{{ 'app.ui.news'|trans }}</a> </li>
<li class="navItem"><a href="{{ path('sylius_shop_product_index', {'slug': 'promotions'}) }}" class="navLink color-red" title="{{ 'app.ui.promotions'|trans }}">{{ 'app.ui.promotions'|trans }}</a> </li>
<li class="navItem"><a href="{{ path('app_shop_partial_product_best_sellers_index') }}" class="navLink color-red" title="{{ 'app.ui.bestsellers'|trans }}">{{ 'app.ui.bestsellers'|trans }}</a> </li>
{% if app.user %}
<li class="navItem" >{% include '@BitBagSyliusWishlistPlugin/Header/_wishlistHeader.html.twig' %}</li>
{% endif %}#}
</ul>
{% endif %}