{% if editmode %}
<div class="edit-box">
<h1>KONFIGURATIONEN FÜR DEN AREABRICK:</h1>
<div class="flex gap-20">
<div class="content flex column gap-20">
<div class="content-box flex gap-20">
<div class="item">
<p class="edit-p">Abstand nach unten wählen:</p>
{{ pimcore_select("MarginBottom", {
"reload": true,
"store": [
["regular", "Normal"],
["half", "1/2"],
["small", "1/4"],
["zero", "kein Abstand"],
],
"defaultValue" : "regular"
}) }}
</div>
<div class="item">
<div class="relation-container">
{{ pimcore_relations("MediaSlider", {
"title": "MediaSlider Objekte ablegen",
"types": ["object"],
"width": 600,
"subtypes": {
"object": ["object"]
},
"classes": ["MediaSlider"]
}) }}
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<section class="media-slider {{ pimcore_select('MarginBottom').getData() }}">
<div class="slider-wrapper">
{% set mediaSlider = pimcore_relations("MediaSlider") %}
{% for slider in mediaSlider %}
<div class="slider-slide {% if loop.first %}--active{% endif %} {% if slider.videoWebm is not null or slider.videoMp4 is not null %}--video{% endif %} {% if slider.youtubeId %}--youtube{% endif %}">
{% if slider.videoWebm is not null or slider.videoMp4 is not null %}
<button class="slider-video-play-button">{{ include('svg/play.html.twig') }}</button>
{% set posterPath = slider.image ? slider.image.getRealFullPath() : null %}
<video class="slider-video" controls playsinline preload="none" {% if posterPath %} poster="{{ posterPath }}"{% endif %}>
{% if slider.videoWebm is not null %}
<source src="{{ slider.videoWebm.getRealFullPath() }}" type="video/webm">
{% endif %}
{% if slider.videoMp4 is not null %}
<source src="{{ slider.videoMp4.getRealFullPath() }}" type="video/mp4">
{% endif %}
Your browser does not support the video tag.
</video>
{% elseif slider.youtubeId is not null %}
<iframe
class="slider__video --youtube"
src="https://www.youtube-nocookie.com/embed/{{ slider.youtubeId }}?autoplay=0&modestbranding=1&iv_load_policy=3"
frameboreder="0"
allow="autoplay; encrypted-media"
allowfullscreen
></iframe>
{% elseif slider.image %}
{{ slider.image.thumbnail('MediaSlider').html({imgAttributes: {
'loading': 'eager',
}}) | raw }}
{% endif %}
<div class="slider-caption">
{% if slider.caption %}
{{ slider.caption|raw }}
{% endif %}
</div>
</div>
{% endfor %}
{% if mediaSlider|length > 1 %}
<button class="slider-prev">{{ include('svg/icon-chevron-left.html.twig') }}</button>
<button class="slider-next">{{ include('svg/icon-chevron-left.html.twig') }}</button>
<div class="slider-pagination">
{% for slider in mediaSlider %}
<div class="slider-pagination-item {% if loop.first %}--active{% endif %}"></div>
{% endfor %}
</div>
{% endif %}
</div>
</section>