<a href="{{ path('produits-entretien-show', {'id':product.id }) }}">
<div class="product row fond-white border-gray-200 mb-10 pa-10 pb-20 pt-20">
<div class="medium-w-25">
{# MAIN IMAGE or NOT #}
{% set mainImage = false %}
{% for image in product.productImages %}
{% if image.isMain and mainImage == false %}
<img class="fl mr-2" src="{{ asset('/upload/products/' ~ product.id ~ '/' ~ image.name) }}" alt="image" width="200">
{% set mainImage = true %}
{% endif %}
{% endfor %}
{% if not mainImage %}
<img class="fl" src="{{ asset('/upload/products/no_main_image.png') }}" title="aucune image pour ce produit" alt="aucune image pour ce produit" width="200">
{% endif %}
{# nb images de galeries (excepté main image #}
{% set countImages = product.productImages|length %}
{% if mainImage %} {# on enlève la main image au compteur #}
{% set countImages = countImages - 1 %}
{% endif %}
{# GALERIES D'IMAGES > 2 thumbs max + nb images suppl. #}
{% set g = 0 %}
{% for image in product.productImages %}
{% if not image.isMain and g < 2 %}
<img class="fl mr-2 mb-2" src="{{ asset('/upload/products/' ~ product.id ~ '/' ~ image.name) }}" alt="image" width="50">
{% set g = g + 1 %}
{% endif %}
{% endfor %}
{% if countImages > 2 %}
{% set moreImages = countImages - 2 %}
<div class="fl mr-2 mb-2 width-50 height-40 fond-gray-900 typo-white text-center pt-7">+ {{ moreImages }}</div>
{% endif %}
</div>
<div class="medium-w-75">
<div class="fr">
{% if product.action | length > 0 %}
{% for action in product.action %}
<span class="badge badge-gray-900 typo-60 majuscule rounded-pill pr-5">{{ action.name }}</span>
{% endfor %}
{% endif %}
{% if product.category | length > 0 %}
{% for category in product.category %}
<span class="badge badge-perso-bleu-clair typo-60 majuscule rounded-pill pr-5">{{ category.name }}</span>
{% endfor %}
{% endif %}
</div>
<h2 class="typo-150 mt-30 mb-10">{{ product.title }}</h2>
{% if product.shortContent %}
<h3>{{ product.shortContent }}</h3>
{% else %}
<h3>{{ product.subtitle }}</h3>
{% endif %}
</div>
</div>
</a>