{% if editmode %}
{{ include('includes/backend-kopf.html.twig') }}
{% set tabContentArray = {1: 'Optional', 2: 'Bildauswahl'} %}
{% set tab = 1 %}
<div id="content">
{% if tabContentArray is defined and tab in tabContentArray|keys %}
{{ admin_tabs(tab, tabContentArray) | raw }}
{% endif %}
<section class="tabContent">
<p class="hl">Optionale Einstellung:</p>
{% set element = 'artikel' %}
<div id="{{ element }} ">
{{ pimcore_multiselect(element, {
'width': 200,
'height': 100,
'store': [
['abstand-top', 'Abstand nach oben'],
['abstand-bottom', 'Abstand nach unten']
]
}) }}
</div>
</section>
{% if tabContentArray is defined and 2 in tabContentArray|keys %}
{{ admin_tabs(2, tabContentArray) | raw }}
<section class="tabContent">
<p class="hl">Optional Headline (H2):</p>
{{ pimcore_areablock("AreablockTop", {
"allowed": ["H2"],
"toolbar": false,
"areablock_toolbar": {
"title": "Content Konfiguration",
"width": 274,
"x": 570,
"y": 41,
"xAlign": "left",
"buttonWidth": 270,
"buttonMaxCharacters": 35
}
})
}}
<br /><br /><hr /><br /><br />
<div style="margin-bottom:4px;margin-top:8px;">Bitte wählen Sie:</div>
<br />
<div style="margin-bottom:10px;">
{% if pimcore_select('gallerySelect').isEmpty() %}
{% do pimcore_select('gallerySelect').setDataFromResource('snippet') %}
{% endif %}
{{ pimcore_select("gallerySelect", {
"store": [
["snippet", "Zuweisung in der eigene Datei"],
["object", "Zuweisung per Objekte"]
],
"width": 300,
"reload": true
}) }}
</div>
{% set showContainerSnippet = "" %}
{% set showContainerObject = "" %}
{% if pimcore_select("gallerySelect").getData() == 'object' %}
{% set showContainerSnippet = ' style="position:absolute;left:-9999em"' %}
{% elseif pimcore_select("gallerySelect").getData() == 'snippet'%}
{% set showContainerObject = ' style="position:absolute;left:-9999em"' %}
{% else %}
{% set showContainerObject = ' style="position:absolute;left:-9999em"' %}
{% endif %}
<div {{ showContainerSnippet }}>
<br /><br /><hr /><br /><br />
{% for i in pimcore_block('sliderblock').iterator %}
<p class="hl">Bild: (Breite 1400 x Höhe 1400 Pixel)</p>
<div class="dragdrop"><span class="parentbox">
{{ pimcore_image("sliderBild",
{"thumbnail": "img-default-edm",
"title": "Bild hier hereinziehen",
"width":150, "height":150,
"hidetext": true
})
}}</span>
</div>
<br /><br /><br /><hr /><hr /><br />
{% endfor %}
</div>
<div{{ showContainerObject }}>
<div style="width: 100%;padding-left:37px;margin-top:30px;">
<p class="hl">Bitte Gallery-Objekt zuweisen:</p>
</div>
<div class="dragdrop">
<span class="parentbox">
{{ pimcore_relation("objectGallery",
{"types": ["object"],
"subtypes": {
"object": ["object"]
},
"classes": ["gallery"],
"width": "750px"
})
}}
</span>
</div>
<br /><br /><br /><br />
</div>
</section>
{% endif %}
</div>
{{ include('includes/backend-fuss.html.twig') }}
{% else %}
{% set abstand_top_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-top') == true)? ' abstand-top' : '' %}
{% set abstand_bottom_class = (checkMultiselect(pimcore_multiselect("artikel"),'abstand-bottom') == true)? ' abstand-bottom' : '' %}
{% set abstandClasses = abstand_top_class ~ abstand_bottom_class %}
{% set sliderId = document.getId() %}
{% set showSnippetArray = [] %}
{% for i in pimcore_block('sliderblock').iterator %}
{% set imageId = pimcore_image("sliderBild").getId() %}
{% set asset = pimcore_asset(imageId) %}
{% if asset is not empty %}
{% set image_path = pimcore_image("sliderBild").getSrc() %}
{% set title = asset.getMetadata("title") %}
{% set showSnippetArray = showSnippetArray|merge({ (loop.index0) :{"path": image_path,"title": title} }) %}
{% endif %}
{% endfor %}
{% if pimcore_select("gallerySelect").getData() == 'object' %}
{% set showGallaryArray = galleryArray %}
{% elseif pimcore_select("gallerySelect").getData() == 'snippet'%}
{% set showGallaryArray = showSnippetArray %}
{% else %}
{% set showGallaryArray = showSnippetArray %}
{% endif %}
<div class="{{ abstandClasses }}">
{% set areaBlock = pimcore_areablock("AreablockTop") %}
{% if areaBlock.isEmpty() == false %}
<div class="constrainer-maxsize edgepadding">
{{ areaBlock | raw }}
</div>
{% endif %}
{% set lang = app.request.getLocale() %}
<div class="constrainer-maxsize">
<div class="owl-carousel owl-theme owl-nav-spacer" data-slider="{{ sliderId }}">
{% for item in showGallaryArray %}
<a class="chocolat-image" href="{{ item.path }}" title="{{ item.title }}" style="display:block;">
{{ imageResponsive({"src": item.path,
"ausgabeformat": "img",
"endtag": true,
"language": lang }) | raw }}
</a>
{% endfor %}
</div>
</div>
</div>
<script type="text/javascript">
(function () {
var moduleName = 'gallery_slider_{{ sliderId }}_module'; // naming convention XXX_module
if (typeof selt === 'undefined') {
selt = {
modules: {}
};
} else if (!selt.modules) {
selt.modules = {};
}
selt.modules[moduleName] = {
name: moduleName,
init: function () {
init();
}
};
function init() {
galleryEl = $('[data-slider="{{ sliderId }}"]');
galleryEl.owlCarousel({
loop: false,
items: 1,
margin: 0,
nav: true,
navText: [
'<svg viewBox="0 0 27.2 105.2" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><polygon class="st0" points="25.4,105.2 0,52 25.4,0 27.2,0.9 2.2,52 27.2,104.3"/></svg>',
'<svg viewBox="0 0 27.2 105.2" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><polygon class="st0" points="25.4,105.2 0,52 25.4,0 27.2,0.9 2.2,52 27.2,104.3"/></svg>'
],
responsive: {
800: {
items: 3,
},
700: {
items: 2,
}
}
});
galleryEl.Chocolat({
loop: true
});
galleryEl.find('.responsiveImg').pictofit('resize');
galleryEl.find('.owl-item > *').matchHeight({
byRow: false
});
}
}());//EOS
</script>
{% endif %}