templates/component/offer.html.twig line 1

Open in your IDE?
  1. {#
  2.     component: offer
  3.     heading: [{
  4.         title {string}: Titre 
  5.         titleAnnex {string}: Titre annexe (au dessus du titre)
  6.     }]
  7.     layout {string}: 1 pour l'image à droite, 2 pour l'image à gauche
  8.     text {string}: Texte
  9.     discountText {string}: Texte de promotion
  10.     image {image}: Image 
  11.         size: {
  12.             width: "660",
  13.             height: "1200"
  14.         }
  15.     imageText {string}: Texte par-dessus l'image
  16.     price {string}: Prix
  17.     link: [{
  18.         text {string}: Texte du lien
  19.         to {string}: Lien
  20.     }]
  21. #}
  22. {% set props = {
  23.     heading: null,
  24.     layout: '1',
  25.     text: null,
  26.     discountText: null,
  27.     image: null,
  28.     imageText: null,
  29.     price: null,
  30.     link: null
  31. }|merge(props|default({}))  %}
  32. <section data-component="offer" class="Offer-component layout-{{ props.layout }}">
  33.     <div class="l-container">
  34.         <div
  35.             class="l-row Offer-row u-v-stretch">
  36.             {# Main #}
  37.             <div
  38.                 class="l-column Offer-main">
  39.                 {# Heading #}
  40.                 {% include "component/heading.html.twig" with {
  41.                     props: props.heading
  42.                 } %}
  43.                 {# Wysiwyg #}
  44.                 <div class="Offer-wysiwyg">
  45.                     {% include "component/wysiwyg.html.twig" with {
  46.                         props: {
  47.                             content: props.text
  48.                         }
  49.                     } %}
  50.                 </div>
  51.                 {% if props.items is defined %}
  52.                     <div class="Offer-list">
  53.                         {% for item in props.items %}
  54.                             <li class="Offer-listItem">
  55.                                 {% include "component/svg.html.twig" with {
  56.                                 props: {
  57.                                     name: item.icon
  58.                                 }
  59.                             } %}
  60.                                 {{ item.text }}
  61.                             </li>
  62.                         {% endfor %}
  63.                     </div>
  64.                 {% endif %}
  65.                 {# Price informations #}
  66.                 {% if props.price or props.link  %}
  67.                 <div
  68.                     class="Offer-priceInformations">
  69.                     {# Discount text #}
  70.                     {% if props.discountText %}
  71.                         <p class="Offer-discountText">{{ props.discountText }}</p>
  72.                     {% endif %}
  73.                     {# Price #}
  74.                     <div class="Offer-price">{{ props.price | raw }}</div>
  75.                     {% if props.link %}
  76.                         {# Link #}
  77.                         <div class="Offer-link">
  78.                             {% include "component/button.html.twig" with {
  79.                                 props: props.link
  80.                             } %}
  81.                         </div>
  82.                     {% endif %}
  83.                 </div>
  84.                 {% endif %}
  85.             </div>
  86.             {# Media #}
  87.             <div class="l-column Offer-media  {% if props.imageText is defined and props.imageText %} has-Subtitle {% endif %} ">
  88.                 <div class="Offer-mediaRatioHelper">
  89.                     <div>
  90.                         {% include "component/image.html.twig" with {
  91.                                 props: props.image
  92.                             } %}
  93.                         {# {% include "component/picture.html.twig" with {
  94.                             props: props.image|merge({
  95.                                 srcWebp: (props.image.src) ? asset(props.image.src | imagine_filter('convert_img_to_webp')) : ''
  96.                             })
  97.                         } %} #}
  98.                     </div>
  99.                 </div>
  100.                 {% if props.imageText %}
  101.                     <p class="Offer-mediaText">
  102.                         {{ props.imageText|raw }}
  103.                     </p>
  104.                 {% endif %}
  105.             </div>
  106.         </div>
  107.     </div>
  108. </div></section>