{% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %}
{% macro item(taxon, isChild) %}
{% import _self as macros %}
{% if taxon.children|length > 0 %}
<div class="col-lg-3 col-md-4 col-6" {{ sylius_test_html_attribute('menu-item') }}>
<div class="categ-bit-index">
<div class="image-categ-i">
{% 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>
<h2 class="title-categ-i"> {{ taxon.name }}</h2>
<p>{{ taxon.description }}</p>
<div class="content-btn-link">
<a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="btn-link">Découvrir</a>
</div>
</div>
</div>
{% else %}
<div class="col-lg-3 col-md-4 col-6">
<div class="categ-bit-index">
<div class="image-categ-i">
{% 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>
<h3 class="title-categ-i"> {{ taxon.name }}</h3>
<p>{{ taxon.description }}</p>
<div class="content-btn-link">
<a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="btn-link">Découvrir</a>
</div>
</div>
</div>
{% endif %}
{% endmacro %}
{% import _self as macros %}
{% if taxons|length > 0 %}
{% for taxon in taxons %}
{{ macros.item(taxon) }}
{% endfor %}
{% endif %}