<!-- TYPE_CONTENUS -->
{% set lienBlocLignes = bloc.lienBlocLignesVisibles %}
{% if lienBlocLignes|length >= 2 %}
{% set lienBlocLignesGauche = lienBlocLignes|slice(0, 1) %}
{% set lienBlocLignesDroite = lienBlocLignes|slice(1) %}
<div class="container">
<div class="row small-gutters categories_grid">
<div class="col-sm-12 col-md-6">
{% set ligne = lienBlocLignesGauche|first.ligne %}
<a href="{{ ligne.boutonLien }}" title="{{ ligne.boutonTitre }}" {% if ligne.boutonTarget is same as(true) %}target="_blank"{% endif %}>
{% if ligne.image is not null %}
<img src="{{ sonata_media(ligne.image, '700_604_thumbnail') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
{% else %}
<img src="{{ asset('build/img/img_cat_home_1.jpg') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
{% endif %}
<div class="wrapper">
<h2>{{ ligne.titre }}</h2>
{% if ligne.texte is not null %}
<p>{{ ligne.texte|striptags|raw }}</p>
{% else %}
<p> </p>
{% endif %}
</div>
</a>
</div>
<div class="col-sm-12 col-md-6">
{% if lienBlocLignesDroite|length == 1 %}
{% set ligne = lienBlocLignesDroite|first.ligne %}
<a href="{{ ligne.boutonLien }}" title="{{ ligne.boutonTitre }}" {% if ligne.boutonTarget is same as(true) %}target="_blank"{% endif %}>
{% if ligne.image is not null %}
<img src="{{ sonata_media(ligne.image, '700_604_thumbnail') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
{% else %}
<img src="{{ asset('build/img/img_cat_home_1.jpg') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
{% endif %}
<div class="wrapper">
<h2>{{ ligne.titre }}</h2>
{% if ligne.texte is not null %}
<p>{{ ligne.texte|striptags|raw }}</p>
{% else %}
<p> </p>
{% endif %}
</div>
</a>
{% endif %}
{% if lienBlocLignesDroite|length > 1 %}
<div class="row small-gutters mt-md-0 mt-sm-2 {% if lienBlocLignesDroite|length == 4 %}five-items{% endif %}">
{% for lienBlocLigne in lienBlocLignesDroite %}
{% set ligne = lienBlocLigne.ligne %}
{% set thumbnail = 'img_cat_home_3.jpg' %}
{% set dimensions = '400_343_thumbnail' %}
{% set class = 'col-sm-6' %}
{% if lienBlocLignesDroite|length == 2 or (lienBlocLignesDroite|length == 3 and loop.last) %}
{% set thumbnail = 'img_cat_home_4.jpg' %}
{% set dimensions = '800_343_thumbnail' %}
{% set class = 'col-sm-12' %}
{% endif %}
{% if loop.last or (lienBlocLignesDroite|length == 4 and loop.index == 3) %}
{% set class = class ~ ' mt-sm-2' %}
{% endif %}
<div class="{{ class }}">
<a href="{{ ligne.boutonLien }}" title="{{ ligne.boutonTitre }}" {% if ligne.boutonTarget is same as(true) %}target="_blank"{% endif %}>
{% if ligne.image is not null %}
<img src="{{ sonata_media(ligne.image, dimensions) }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
{% else %}
<img src="{{ asset('build/img/'~thumbnail) }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
{% endif %}
<div class="wrapper">
<h2>{{ ligne.titre }}</h2>
{% if ligne.texte is not null %}
<p>{{ ligne.texte|striptags|raw }}</p>
{% else %}
<p> </p>
{% endif %}
</div>
</a>
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}