{#
component: accordion content
layout {string}: 1 pour l'image à droite, 2 pour l'image à gauche
contents: [{
text {string}: Texte de la section
title {string}: Titre de la section
image {image}: Image de la section
size: {
width: "660",
height: "840"
}
links: [{
text {string}: Texte du lien
to {string}: Lien
}]
}]
#}
{% set props = {
layout: '1',
contents: [{
text:null,
title:null,
image:null,
links:null
}]
}|merge(props|default({})) %}
<section data-component="accordion-content" class="AccordionContent-component layout-{{ props.layout }}">
<div class="l-container">
<div class="l-row">
<div
class="l-column AccordionContent-main">
{# Nav #}
<div
class="1-row AccordionContent-nav">
{# Arrows #}
<div
class="AccordionContent-navButtons">
{# Previous button #}
<button ref="previousButton" class="AccordionContent-navButton AccordionContent-navPreviousButton">
{% include "component/svg.html.twig" with {
props: {
name: 'arrow-left'
}
} %}
</button>
{# Next button #}
<button ref="nextButton" class="AccordionContent-navButton AccordionContent-navNextButton">
{% include "component/svg.html.twig" with {
props: {
name: 'arrow-right'
}
} %}
</button>
</div>
</div>
{% if props.heading is defined %}
{# Heading #}
{% include "component/heading.html.twig" with {
props: props.heading
} %}
{% endif %}
{% for content in props.contents %}
<div
class="AccordionContent-contentItem {% if loop.index0 == 0 %}opened{% endif %}" ref="items">
{# Item title #}
<p class="AccordionContent-contentItemTitle">{{ content.title }}</p>
<div class="AccordionContent-contentItemMain" ref="main">
{% if content.text is defined %}
{# Item text #}
<p class="AccordionContent-contentItemText">
{% include "component/wysiwyg.html.twig" with {
props: {
content: content.text
}
} %}
</p>
{% endif %}
{% if content.links is defined %}
{# Item links #}
<div class="AccordionContent-contentItemLinks" ref="buttons">
{% for link in content.links %}
<div class="AccordionContent-contentItemLinkContainer">
{% include "component/button.html.twig" with {
props: link
} %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
<div class="l-column AccordionContent-media" ref="container">
<div class="AccordionContent-mediaRatioHelper">
{% for content in props.contents %}
<div class="AccordionContent-imageContainer {% if loop.index0 == 0 %}opened{% endif %}" ref="images">
{% include "component/image.html.twig" with {
props: content.image
} %}
{# {% include "component/picture.html.twig" with {
props: content.image|merge({
srcWebp: (content.image.src) ? asset(content.image.src | imagine_filter('convert_img_to_webp')) : ''
})
} %} #}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</section>