templates/component/to_discover.html.twig line 1

Open in your IDE?
  1. {#
  2.     component: to discover
  3.     heading: [{
  4.         title {string}: Titre des découvertes
  5.         titleAnnex {string}: Titre annexe des découvertes (au dessus du titre)
  6.     }]
  7.     items: [{
  8.         image {image}: Image de la découverte
  9.             size: {
  10.                 width: "630",
  11.                 height: "270"
  12.             }
  13.         heading: [{
  14.             title {string}: Titre de la découverte
  15.             titleAnnex {string}: Titre annexe de la découverte (au dessus du titre)
  16.         }],
  17.         to {string}: Lien de la découverte
  18.     }]
  19.     
  20. #}
  21. {% set props = {
  22.   heading: {
  23.     title: null,
  24.     titleAnnex: null,
  25.   },
  26.   items: null,
  27. }|merge(props|default({}))  %}
  28. <section data-component="to-discover" class="ToDiscover-component">
  29.     <div
  30.         class="l-container">
  31.         {# Heading #}
  32.         {% include "component/heading.html.twig" with {
  33.       
  34.       props: props.heading
  35.     } %}
  36.         <div class="l-row ToDiscover-row {% if props.items|length < 3 %} small-content {% endif %}" ref="container">
  37.             {% for item in props.items %}
  38.                 <a class="ToDiscover-item" href="{{ item.to }}" ref="items">
  39.                     <div class="ToDiscover-itemInner">
  40.                         <div
  41.                             class="ToDiscover-itemImage">
  42.                             {# Item image #}
  43.                             {% include "component/image.html.twig" with {
  44.                                 props: item.image
  45.                             } %}
  46.                             {# {% include "component/picture.html.twig" with {
  47.                                 props: item.image|merge({
  48.                                     srcWebp: (item.image.src) ? asset(item.image.src | imagine_filter('convert_img_to_webp')) : ''
  49.                                 })
  50.                             } %} #}
  51.                         </div>
  52.                         {# Item heading #}
  53.                         {% include "component/heading.html.twig" with {
  54.                             props: item.heading
  55.                         } %}
  56.                     </div>
  57.                 </a>
  58.             {% endfor %}
  59.         </div>
  60.     </div>
  61. </section>