templates/bloc/_bloc_9.html.twig line 1

Open in your IDE?
  1. <!-- TYPE_CONTENUS -->
  2. {% set lienBlocLignes = bloc.lienBlocLignesVisibles %}
  3. {% if lienBlocLignes|length >= 2 %}
  4.     {% set lienBlocLignesGauche = lienBlocLignes|slice(0, 1) %}
  5.     {% set lienBlocLignesDroite = lienBlocLignes|slice(1) %}
  6.     <div class="container">
  7.         <div class="row small-gutters categories_grid">
  8.             <div class="col-sm-12 col-md-6">
  9.                 {% set ligne = lienBlocLignesGauche|first.ligne %}
  10.                 <a href="{{ ligne.boutonLien }}" title="{{ ligne.boutonTitre }}" {% if ligne.boutonTarget is same as(true) %}target="_blank"{% endif %}>
  11.                     {% if ligne.image is not null %}
  12.                         <img src="{{ sonata_media(ligne.image, '700_604_thumbnail') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
  13.                     {% else %}
  14.                         <img src="{{ asset('build/img/img_cat_home_1.jpg') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
  15.                     {% endif %}
  16.                     <div class="wrapper">
  17.                         <h2>{{ ligne.titre }}</h2>
  18.                         {% if ligne.texte is not null %}
  19.                             <p>{{ ligne.texte|striptags|raw }}</p>
  20.                         {% else %}
  21.                             <p>&nbsp;</p>
  22.                         {% endif %}
  23.                     </div>
  24.                 </a>
  25.             </div>
  26.             <div class="col-sm-12 col-md-6">
  27.                 {% if lienBlocLignesDroite|length == 1 %}
  28.                     {% set ligne = lienBlocLignesDroite|first.ligne %}
  29.                     <a href="{{ ligne.boutonLien }}" title="{{ ligne.boutonTitre }}" {% if ligne.boutonTarget is same as(true) %}target="_blank"{% endif %}>
  30.                         {% if ligne.image is not null %}
  31.                             <img src="{{ sonata_media(ligne.image, '700_604_thumbnail') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
  32.                         {% else %}
  33.                             <img src="{{ asset('build/img/img_cat_home_1.jpg') }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
  34.                         {% endif %}
  35.                         <div class="wrapper">
  36.                             <h2>{{ ligne.titre }}</h2>
  37.                             {% if ligne.texte is not null %}
  38.                                 <p>{{ ligne.texte|striptags|raw }}</p>
  39.                             {% else %}
  40.                                 <p>&nbsp;</p>
  41.                             {% endif %}
  42.                         </div>
  43.                     </a>
  44.                 {% endif %}
  45.                 {% if lienBlocLignesDroite|length > 1 %}
  46.                     <div class="row small-gutters mt-md-0 mt-sm-2 {% if lienBlocLignesDroite|length == 4 %}five-items{% endif %}">
  47.                         {% for lienBlocLigne in lienBlocLignesDroite %}
  48.                             {% set ligne = lienBlocLigne.ligne %}
  49.                             {% set thumbnail    = 'img_cat_home_3.jpg' %}
  50.                             {% set dimensions   = '400_343_thumbnail' %}
  51.                             {% set class        = 'col-sm-6' %}
  52.                             {% if lienBlocLignesDroite|length == 2 or (lienBlocLignesDroite|length == 3 and loop.last) %}
  53.                                 {% set thumbnail    = 'img_cat_home_4.jpg' %}
  54.                                 {% set dimensions   = '800_343_thumbnail' %}
  55.                                 {% set class        = 'col-sm-12' %}
  56.                             {% endif %}
  57.                             {% if loop.last or (lienBlocLignesDroite|length == 4 and loop.index == 3) %}
  58.                                 {% set class = class ~ ' mt-sm-2' %}
  59.                             {% endif %}
  60.                             <div class="{{ class }}">
  61.                                 <a href="{{ ligne.boutonLien }}" title="{{ ligne.boutonTitre }}" {% if ligne.boutonTarget is same as(true) %}target="_blank"{% endif %}>
  62.                                     {% if ligne.image is not null %}
  63.                                         <img src="{{ sonata_media(ligne.image, dimensions) }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
  64.                                     {% else %}
  65.                                         <img src="{{ asset('build/img/'~thumbnail) }}" alt="{{ ligne.getAlt }}" class="img-fluid" />
  66.                                     {% endif %}
  67.                                     <div class="wrapper">
  68.                                         <h2>{{ ligne.titre }}</h2>
  69.                                         {% if ligne.texte is not null %}
  70.                                             <p>{{ ligne.texte|striptags|raw }}</p>
  71.                                         {% else %}
  72.                                             <p>&nbsp;</p>
  73.                                         {% endif %}
  74.                                     </div>
  75.                                 </a>
  76.                             </div>
  77.                         {% endfor %}
  78.                     </div>
  79.                 {% endif %}
  80.             </div>
  81.         </div>
  82.     </div>
  83. {% endif %}