{#
component: offer
heading: [{
title {string}: Titre
titleAnnex {string}: Titre annexe (au dessus du titre)
}]
layout {string}: 1 pour l'image à droite, 2 pour l'image à gauche
text {string}: Texte
discountText {string}: Texte de promotion
image {image}: Image
size: {
width: "660",
height: "1200"
}
imageText {string}: Texte par-dessus l'image
price {string}: Prix
link: [{
text {string}: Texte du lien
to {string}: Lien
}]
#}
{% set props = {
heading: null,
layout: '1',
text: null,
discountText: null,
image: null,
imageText: null,
price: null,
link: null
}|merge(props|default({})) %}
<section data-component="offer" class="Offer-component layout-{{ props.layout }}">
<div class="l-container">
<div
class="l-row Offer-row u-v-stretch">
{# Main #}
<div
class="l-column Offer-main">
{# Heading #}
{% include "component/heading.html.twig" with {
props: props.heading
} %}
{# Wysiwyg #}
<div class="Offer-wysiwyg">
{% include "component/wysiwyg.html.twig" with {
props: {
content: props.text
}
} %}
</div>
{% if props.items is defined %}
<div class="Offer-list">
{% for item in props.items %}
<li class="Offer-listItem">
{% include "component/svg.html.twig" with {
props: {
name: item.icon
}
} %}
{{ item.text }}
</li>
{% endfor %}
</div>
{% endif %}
{# Price informations #}
{% if props.price or props.link %}
<div
class="Offer-priceInformations">
{# Discount text #}
{% if props.discountText %}
<p class="Offer-discountText">{{ props.discountText }}</p>
{% endif %}
{# Price #}
<div class="Offer-price">{{ props.price | raw }}</div>
{% if props.link %}
{# Link #}
<div class="Offer-link">
{% include "component/button.html.twig" with {
props: props.link
} %}
</div>
{% endif %}
</div>
{% endif %}
</div>
{# Media #}
<div class="l-column Offer-media {% if props.imageText is defined and props.imageText %} has-Subtitle {% endif %} ">
<div class="Offer-mediaRatioHelper">
<div>
{% include "component/image.html.twig" with {
props: props.image
} %}
{# {% include "component/picture.html.twig" with {
props: props.image|merge({
srcWebp: (props.image.src) ? asset(props.image.src | imagine_filter('convert_img_to_webp')) : ''
})
} %} #}
</div>
</div>
{% if props.imageText %}
<p class="Offer-mediaText">
{{ props.imageText|raw }}
</p>
{% endif %}
</div>
</div>
</div>
</div></section>