{% set brickAnchorId = '' %}
{% if pimcore_input("brickAnchorIdInput") is not empty %}
{% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
{% endif %}
{% set carouselElements = pimcore_block('carouselSlides') %}
{% set variant = pimcore_checkbox("variant").isChecked() %}
{% if editmode %}
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-6 l-4">
<span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
{{ pimcore_input("brickAnchorIdInput") }}
</div>
<div class="col xs-12 m-6 l-4">
<span class="hint">Layout Variante</span>
{{ pimcore_checkbox("variant", {"reload": true}) }}Bilder <strong>nicht</strong> beschneiden?
</div>
<div class="col xs-12 m-6 l-2">
<span class="hint">Autoplay</span>
{{ pimcore_checkbox("autoplay") }}Autoplay aktivieren?
<div><small>(Slide wechselt dann automatisch)</small></div>
</div>
<div class="col xs-12 m-6 l-2">
<span class="hint">Autoplay Zeit (1000 = 1 Sekunde)</span>
{{ pimcore_input("autoplayTime", {"placeholder": "4000"}) }}
</div>
</div>
<div class="offset-bottom-single">
<strong>Carousel</strong>
{% for i in pimcore_iterate_block(pimcore_block('carouselSlides')) %}
{% set imageVideoSelectorResult = pimcore_select("imageVideoSelector").getData() %}
<div>
<span><strong>{{ loop.index }}. Slide</strong></span>
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-4 l-4">
{% if pimcore_select("imageVideoSelector").isEmpty() %}
{% do pimcore_select("imageVideoSelector").setDataFromResource("image") %}
{% endif %}
<span class="hint">{{ 'Möchten Sie ein Bild oder Video integrieren?' |trans }}</span>
<div class="select-items">
{% if variant == '1' %}
In der Layout Variante ohne Beschnitt sind nur Bilder möglich.<br/>
{% else %}
{{ pimcore_select("imageVideoSelector", {
"store": [
["image", "Bild"],
["video", "Video"]
],
"width": 300,
"reload": true
}) }}
{% endif %}
</div>
<div>
<br/>
<div class="flex-col">
<div class="xs-4 m-4 l-4">
<div class="hint">Link:</div>
</div>
<div class="xs-8 m-8 l-8">
{{ pimcore_link('productLink') }}
</div>
</div>
<div class="flex-col">
<div class="xs-4 m-4 l-4"></div>
<div class="xs-8 m-8 l-8">
{{ pimcore_checkbox('slideAsLink') }}Ganzer Slide ist Link (ohne Button)
</div>
</div>
</div>
</div>
<div class="col xs-12 m-4 l-4">
{% if imageVideoSelectorResult == 'video' and (variant != '1') %}
<span class="hint">{{ 'Youtube ID eingeben' |trans }}</span>
{{ pimcore_input("youtubeID", {
"width": 320,
"reload": true
}
) }}
{% else %}
<span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
{{ pimcore_image("mainStage", {
"title": "Drag your image here",
"width": 320,
"reload": true
}) }}
{% endif %}
</div>
<div class="col xs-12 m-4 l-4">
<div class="hint">Sublines:</div>
<div class="text-center">
{{ pimcore_input("mainStageHeadlineTwo", {
"placeholder": '1. Subline / Part 2'
})|trademark }}
</div>
<div class="text-center" style="margin-top:5px">
{{ pimcore_input("mainStageHeadlineThree", {
"placeholder": '2. Subline / Part 3'
})|trademark }}
</div>
<div class="hint" style="margin-top:8px">Headline (H1 oder H2):</div>
<div style="padding-bottom:7px">{{ pimcore_checkbox("setH1") }}als H1 setzten</div>
<div class="text-center">
{{ pimcore_input("mainStageHeadlineOne", {
"placeholder": 'Headline / Part 1'
})|trademark }}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
<hr/>
{% else %}
{% if pimcore_checkbox("variant").isChecked() %}
{% set variant = '1' %}
{% endif %}
{% set thumbnailName = "mainStageBackground" ~ bundleName %}
{% if variant == '1' or pimcore_checkbox("variant").value == true %}
{% set thumbnailName = "mainStageCarouselNoCover" %}
{% endif %}
{% set thumbnailName = "mainStageCarouselNoCover" %}
{% if carouselElements is defined %}
{% set slideCount = carouselElements.getCount() %}
{% if slideCount > 0 %}
<div id="{{ brickAnchorId }}" class="{% if variant == '1' %}main-stage-carousel_noCover{% endif %}{% if slideCount == 1 %} main-stage-carousel_single-item{% endif %}">
{% if slideCount > 1 %}
{% set autoplayTime = pimcore_input("autoplayTime") %}
{% if autoplayTime is empty %}
{% set autoplayTime = '4000' %}
{% endif %}
<div
class="main-stage-carousel main-stage_loading {% if pimcore_checkbox('autoplay').isChecked() %} main-stage-carousel_autoplay{% else %} main-stage-carousel_single{% endif %}"
data-slick='{"autoplaySpeed": {{ autoplayTime }}}'
>
{% endif %}
{% for i in pimcore_iterate_block(pimcore_block('carouselSlides')) %}
{% set imageVideoSelectorResult = pimcore_select("imageVideoSelector").getData() %}
{% set hTag = 'h2' %}
{% if pimcore_checkbox("setH1").isChecked() %}
{% set hTag = 'h1' %}
{% endif %}
{% set productLink = pimcore_link('productLink', {'class': "button btn-default w-auto"}) %}
{% set productLinkHref = productLink.getHref() %}
{% set slideAsLink = pimcore_checkbox("slideAsLink").isChecked() %}
<div class="main-stage-slide stage stage-carousel">
<div class="stage-image main {% if imageVideoSelectorResult == 'video' %}video-header {% endif %}stage-with-anchor">
{% if imageVideoSelectorResult == 'video' and (variant != '1') %}
{# Slide content is video #}
{% set videoIDResult = pimcore_input("youtubeID") %}
{% set videoID = 'uid' ~ uniqid() |raw %}
<div class="video-wrapper">
<div class="iframe-container">
<div id="{{ videoID }}" class="mute-yt-player-stage" data-video-id-result="{{ videoIDResult }}"></div>
</div>
</div>
<script>
window.onload = function () {
// video stage with image on mobile
if (($(window).width()) < 768) {
var ytImageDefault = 'https://img.youtube.com/vi/' + $('.mute-yt-player-stage').data("videoIdResult") + '/maxresdefault.jpg';
$('.mute-yt-player-stage').css('background-image', 'url(' + ytImageDefault + ')');
} else {
$('#{{ videoID }}').each(function () {
initYoutubeVideoPLayerContainerStage($(this).attr('id'), $(this).data("videoIdResult"));
});
}
}
</script>
{% else %}
{# Slide content is image #}
<div class="image-wrapper">
{% if pimcore_image("mainStage").getThumbnail(thumbnailName) is not empty %}
{{ pimcore_image("mainStage").getThumbnail(thumbnailName).getHTML() |raw }}
{% endif %}
</div>
{% endif %}
{# Slide Headlines #}
<div class="text-container">
<div class="main-content">
<div class="text">
<div class="special-headline">
<div class="main-stage-carousel_first">
{{ pimcore_input("mainStageHeadlineTwo")|trademark }}
</div>
<div class="main-stage-carousel_second">
{{ pimcore_input("mainStageHeadlineThree")|trademark }}
</div>
{{ ('<' ~ hTag ~ ' class="main-stage-carousel_third">') | raw }}
{{ pimcore_input("mainStageHeadlineOne")|trademark }}
{{ ('</' ~ hTag ~ '>') | raw }}
</div>
{% if slideAsLink != '1' %}
{% if imageVideoSelectorResult == 'image' %}
<div class="cta-row">
{% endif %}
<div class="text-center" style="margin-top:4px">{{ productLink | raw }}</div>
{% if imageVideoSelectorResult == 'image' %}
</div>
{% endif %}
{% endif %}
</div>
</div>
<div class="with-anchor">
<a href="#content-section" class="content-anchor offset-top"></a>
</div>
</div>
{% if slideAsLink == '1' and (not productLink.getHref() is empty) %}
<a class="main-stage-carousel_slide-link" href="{{ productLink.getHref() }}"></a>
{% endif %}
{# Slide end #}
</div>
</div>
{% endfor %}
{% if slideCount > 1 %}
</div>
{% endif %}
</div>
{% endif %}
{% endif %}
{% endif %}