{#
component: hero content
title {string}: Titre
titleAnnex {string|null}: Sur titre au dessus du titre (Default: null, pas de sur titre)
background {image}:
size: {
width: "1440",
height: "540"
}
breadcrumb {array|null}: tableau des liens du fil d'ariane (chacun contenant title, to, et text) (Default: null, pas de breadcrumb)
#}
{% set props = {
heading: null,
video:null,
background: null,
breadcrumb: null
}|merge(props|default({})) %}
<section data-component="hero-content" class="HeroContent-component">
<div class="l-container u-fh">
<div class="l-row u-fh">
<div
class="l-column HeroContent-wrapper">
{# Background #}
<div class="HeroContent-backgroundMedia">
{% if not props.video %}
{% include "component/image.html.twig" with {
props: props.background
} only %}
{# {% include "component/picture.html.twig" with {
props: props.background|merge({
srcWebp: (props.background.src) ? asset(props.background.src | imagine_filter('convert_img_to_webp')) : ''
})
} only %} #}
{% endif %}
{% if props.video %}
{% include "component/image.html.twig" with {
props: props.background
} only %}
{# {% include "component/picture.html.twig" with {
props: props.background|merge({
srcWebp: (props.background.src) ? asset(props.background.src | imagine_filter('convert_img_to_webp')) : ''
})
} %} #}
{% include "component/video.html.twig" with {
props: props.video
} only %}
{% endif %}
</div>
{# Main #}
<div
class="HeroContent-main">
{# Heading #}
<div class="HeroContent-heading">
{% include "component/heading.html.twig" with {
props: props.heading|merge_object({
hLevel: '1'
})
} %}
</div>
{# Breadcrumb #}
{% if props.breadcrumb %}
<ol class="HeroContent-breadcrumb">
{% for item in props.breadcrumb %}
{# Breadcrumb item #}
<li class="HeroContent-breadcrumbItem">
{% if loop.index == props.breadcrumb|length %}
<span>{{ item.text }}</span>
{% else %}
<a href="{{ item.to }}" title="{{ item.title }}" class="HeroContent-breadcrumbItemLink">{{ item.text }}</a>
{% endif %}
</li>
{% endfor %}
</ol>
{% endif %}
</div>
</div>
</div>
</div>
</section>