templates/component/hero_content.html.twig line 1

Open in your IDE?
  1. {#
  2.     component: hero content
  3.     title {string}: Titre
  4.     titleAnnex {string|null}: Sur titre au dessus du titre (Default: null, pas de sur titre)
  5.   background {image}:     
  6.     size: {
  7.       width: "1440",
  8.       height: "540"
  9.     }
  10.   breadcrumb {array|null}: tableau des liens du fil d'ariane (chacun contenant title, to, et text) (Default: null, pas de breadcrumb)
  11. #}
  12. {% set props = {
  13.     heading: null,
  14.     video:null,
  15.     background: null,
  16.     breadcrumb: null
  17. }|merge(props|default({}))  %}
  18. <section data-component="hero-content" class="HeroContent-component">
  19.     <div class="l-container u-fh">
  20.         <div class="l-row u-fh">
  21.             <div
  22.                 class="l-column HeroContent-wrapper">
  23.                 {# Background #}
  24.                 <div class="HeroContent-backgroundMedia">
  25.                     {% if not props.video %}
  26.                         {% include "component/image.html.twig" with {
  27.                             props: props.background
  28.                         } only %}
  29.                         {# {% include "component/picture.html.twig" with {
  30.                             props: props.background|merge({
  31.                                 srcWebp: (props.background.src) ? asset(props.background.src | imagine_filter('convert_img_to_webp')) : ''
  32.                             })
  33.                         } only %} #}
  34.                     {% endif %}
  35.                     {% if props.video %}
  36.                         {% include "component/image.html.twig" with {
  37.                             props: props.background
  38.                         } only %}
  39.                         {# {% include "component/picture.html.twig" with {
  40.                             props: props.background|merge({
  41.                                 srcWebp: (props.background.src) ? asset(props.background.src | imagine_filter('convert_img_to_webp')) : ''
  42.                             })
  43.                         } %} #}
  44.                         {% include "component/video.html.twig" with {
  45.                             props: props.video
  46.                         } only %}
  47.                     {% endif %}
  48.                 </div>
  49.                 {# Main #}
  50.                 <div
  51.                     class="HeroContent-main">
  52.                     {# Heading #}
  53.                     <div class="HeroContent-heading">
  54.                         {% include "component/heading.html.twig" with {
  55.               props: props.heading|merge_object({
  56.                 hLevel: '1'
  57.               })
  58.             } %}
  59.                     </div>
  60.                     {# Breadcrumb #}
  61.                     {% if props.breadcrumb %}
  62.                         <ol class="HeroContent-breadcrumb">
  63.                             {% for item in props.breadcrumb %}
  64.                                 {# Breadcrumb item #}
  65.                                 <li class="HeroContent-breadcrumbItem">
  66.                                     {% if loop.index == props.breadcrumb|length %}
  67.                                         <span>{{ item.text }}</span>
  68.                                     {% else %}
  69.                                         <a href="{{ item.to }}" title="{{ item.title }}" class="HeroContent-breadcrumbItemLink">{{ item.text }}</a>
  70.                                     {% endif %}
  71.                                 </li>
  72.                             {% endfor %}
  73.                         </ol>
  74.                     {% endif %}
  75.                 </div>
  76.             </div>
  77.         </div>
  78.     </div>
  79. </section>