templates/component/home_introduction.html.twig line 1

Open in your IDE?
  1. {#
  2.     component: home introduction
  3.     text {string}: Text d'introduction
  4.     firstImage {image}: Première image d'introduction
  5.         size: {
  6.             width: "480",
  7.             height: "360"
  8.         }
  9.     secondImage {image}: Deuxième image d'introduction
  10.         size: {
  11.             width: "480",
  12.             height: "550"
  13.         }
  14.     link: [{
  15.         text {string}: Texte du lien
  16.         to {string}: Lien
  17.     }]
  18. #}
  19. {% set props = {
  20.   heading: null,
  21.     text:null,
  22.     shape:{
  23.         src:null,
  24.         backgroundcolor:false
  25.     }
  26. }|merge(props|default({}))  %}
  27. <section
  28.     data-component="home-introduction" class="HomeIntroduction-component">
  29.     {# Background pattern #}
  30.     <div class="HomeIntroduction-backgroundPattern ">
  31.         {% include "component/waves.html.twig"  with {
  32.                 props: {
  33.                     speed:0.1,
  34.                     shape:props.shape
  35.                 }
  36.         } %}
  37.     </div>
  38.     <div class="l-container">
  39.         <div
  40.             class="l-row">
  41.             {# Heading #}
  42.             {% include "component/heading.html.twig" with {
  43.                 props: props.heading
  44.             } %}
  45.         </div>
  46.         <div class="l-row HomeIntroduction-firstContent">
  47.             <div class="l-column HomeIntroduction-firstImage">
  48.                 {# 1st image #}
  49.                 {% include "component/image.html.twig" with {
  50.                     props: props.firstImage
  51.                 } %}
  52.                 
  53.                 {# Exemple of pictrue with webp src #}
  54.                 {# {% if props.firstImage %}
  55.                     {% include "component/picture.html.twig" with {
  56.                             props: props.firstImage|merge({
  57.                                 srcWebp: (props.firstImage.src) ? asset(props.firstImage.src | imagine_filter('convert_img_to_webp')) : ''
  58.                             })
  59.                     } %}
  60.                 {% endif %} #}
  61.             </div>
  62.         </div>
  63.         <div
  64.             class="l-row HomeIntroduction-secondContent">
  65.             {# Main #}
  66.             <div
  67.                 class="l-column HomeIntroduction-main">
  68.                 {# Text #}
  69.                 <div class="HomeIntroduction-wysiwyg">
  70.                     {% include "component/wysiwyg.html.twig" with {
  71.                         props: {
  72.                             content: props.text
  73.                         }
  74.                     } %}
  75.                 </div>
  76.                 {% if props.link is defined %}
  77.                     {# Button #}
  78.                     <div class="HomeIntroduction-button">
  79.                         {% include "component/button.html.twig" with {
  80.                         props: props.link
  81.                     } %}
  82.                     </div>
  83.                 {% endif %}
  84.             </div>
  85.             <div
  86.                 class="l-column HomeIntroduction-secondImage">
  87.                 {# 2nd image #}
  88.                 {% include "component/image.html.twig" with {
  89.                     props: props.secondImage
  90.                 } %}
  91.                 {# Exemple of pictrue with webp src #}
  92.                 {# {% if props.secondImage %}
  93.                     {% include "component/picture.html.twig" with {
  94.                             props: props.secondImage|merge({
  95.                                 srcWebp: (props.secondImage.src) ? asset(props.secondImage.src | imagine_filter('convert_img_to_webp')) : ''
  96.                             })
  97.                     } %}
  98.                 {% endif %} #}
  99.             </div>
  100.         </div>
  101.     </div>
  102. </section>