{% set spacingSelect %}
{{ pimcore_checkbox("checkSpacing", {
"reload": true
}) }}
{% endset %}
{% set noSpacingTop = '' %}
{% set brickAnchorId = '' %}
{% if pimcore_checkbox('checkSpacing').isChecked() %}
{% set noSpacingTop = 'no-offset-top' %}
{% endif %}
{% set UID = uniqid() %}
{% if pimcore_input("brickAnchorIdInput") is not empty %}
{% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
{% endif %}
{% set imageVideoSelectorResult = pimcore_select("imageVideoSelector").getData() %}
{% if editmode %}
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-6 l-3">
<span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
{{ pimcore_input("brickAnchorIdInput") }}
</div>
</div>
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-6">
{% 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">
{{ pimcore_select("imageVideoSelector", {
"store": [
["image", "Bild"],
["video", "Video"]
],
"width": 300,
"reload": true
}) }}
{% do pimcore_select("imageVideoSelector").setDataFromResource("image") %}
</div>
</div>
<div class="col xs-12 m-6">
{% if imageVideoSelectorResult == 'image' or pimcore_select("imageVideoSelector").isEmpty() %}
<span class="hint">{{ 'Hintergrundbild festlegen' |trans }}</span>
{{ pimcore_image("mainStage", {
"title": "Drag your image here",
"thumbnail": "mainStageBackground",
"width": 300,
"height": 150,
"reload": true
}) }}
{% endif %}
{% if imageVideoSelectorResult == 'video' %}
<span class="hint">{{ 'Youtube ID eingeben' |trans }}</span>
{{ pimcore_input("youtubeID", {
"width": 300,
"reload": true
}
) }}
{% endif %}
</div>
</div>
{% endif %}
<div id="{{ brickAnchorId }}" class="stage">
<div class="stage-image main {% if imageVideoSelectorResult == 'video' %}video-header {% endif %}stage-with-anchor">
{% if imageVideoSelectorResult == 'image' %}
<div class="image-wrapper">
{% if pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName) is not empty %}
{{ pimcore_image("mainStage").getThumbnail("mainStageBackground" ~ bundleName).getHTML() |raw }}
{% endif %}
</div>
{#IE Fix for thumbnails rendering start#}
<script type='text/javascript'>
var waitForJQuery = setInterval(function () {
if (typeof $ != 'undefined') {
$(function() {
if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
$(".stage.main .image-wrapper").css({
position: "absolute",
width: "100%",
height: "100%",
background: "url( {{ pimcore_image("mainStage").getSrc() }} ) center right 100%/cover no-repeat"
});
$(".stage.main .image-wrapper img").hide();
}
});
clearInterval(waitForJQuery);
}
}, 50);
</script>
{#IE Fix for thumbnails rendering end#}
{% endif %}
{% if imageVideoSelectorResult == 'video' %}
{% set videoIDResult = pimcore_input("youtubeID") %}
{% set videoID = 'uid' ~ UID |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>
{% if not editmode %}
<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>
{% endif %}
{% endif %}
<div class="text-container">
<div class="main-content">
<div class="text">
<div class="uppercase special-headline">
<h1>
<span>{{ pimcore_input("mainStageHeadlineOne", {
"placeholder": 'Headline Part 1'
})|trademark }}</span>
{{ pimcore_input("mainStageHeadlineTwo", {
"placeholder": 'Headline Part 2'
})|trademark }}
<strong>{{ pimcore_input("mainStageHeadlineThree", {
"placeholder": 'Headline Part 3'
})|trademark }}</strong>
</h1>
</div>
{% if imageVideoSelectorResult == 'video' %}
{{ pimcore_link('productLink', {'class': "button btn-outline"}) }}
{% else %}
<div class="cta-row">
{{ pimcore_link('productLink', {'class': "button btn-default"}) }}
{{ pimcore_link('productLinkSecondary', {'class': "button btn-default"}) }}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>