{% if editmode %}
{% if pimcore_block('gallery').isEmpty() and defaultGalleryItems is defined %}
{% embed 'app/editmodenotice.html.twig' %}
{% block title %} Standaard Afbeeldingen automatisch geselecteerd {% endblock %}
{% block information %}
Vanuit een koppeling met een gerelateerd Object zijn er afbeeldingen gekozen om te tonen.
Indien u gebruik wenst te maken van andere afbeeldingen dan vult u hier nieuwe afbeeldingen.
{% for image in defaultGalleryItems %}
{{ image.thumbnail('gallery').html({
'class':'w-full',
'pictureAttributes': {
class: 'w-full'
}
}) | raw }}
{% endfor %}
{% endblock %}
{% endembed %}
{% endif %}
{% for i in pimcore_block('gallery', {'reload': true, 'limit' : 4}).iterator %}
{{ pimcore_image('image',
{
'thumbnail': 'gallery',
'reload': 'true',
'class':'w-full',
'pictureAttributes': {class: 'w-full'}
}
) }}
{% endfor %}
{% else %}
<div class="!-mx-5 md:!mx-auto md:rounded-md overflow-hidden swiper slideshow-swiper max-h-60 md:max-h-full">
<div class=" swiper-wrapper">
{# Load the manually selectable gallery items #}
{% for i in pimcore_block('gallery', {'reload': true, 'limit' : 4}).iterator %}
<div class="swiper-slide">
{{ pimcore_image('image',
{
'thumbnail': 'gallery',
'reload': 'true',
'pictureAttributes': {class: 'w-full block aspect-[4/3] rounded-md '},
'imgAttributes': {class: 'w-full h-full object-cover object-center max-h-60 md:max-h-full'}
}
) }}
</div>
{% endfor %}
{# If a default set of gallery items is available and no manual gallery items are added
iterate through the supplied defaultGalleryItems. #}
{% if pimcore_block('gallery').isEmpty()
and defaultGalleryItems is defined %}
{% for image in defaultGalleryItems %}
<div class="swiper-slide">
{{ image.thumbnail('gallery').html({
'pictureAttributes': {
class: 'w-full block aspect-[4/3] rounded-md'
},
'imgAttributes': {
class: 'w-full h-full object-cover object-center max-h-60 md:max-h-full'
}
})|raw }}
</div>
{% endfor %}
{% endif %}
</div>
<div class="absolute z-20 flex gap-2 bottom-4 right-4">
<div class="custom-swiper-button-prev">
<svg class="w-4 h-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 12">
<path fill="#FFF" fill-rule="evenodd"
d="M15.106 6.883H3.396l3.218 3.218a.885.885 0 1 1-1.252 1.252L.707 6.695a1 1 0 0 1 0-1.414L5.362.626a.885.885 0 1 1 1.252 1.252L3.396 5.095h11.71a.894.894 0 0 1 0 1.788Z"/>
</svg>
</div>
<div class="custom-swiper-button-next">
<svg class="w-4 h-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 12">
<path fill="#FFF" fill-rule="evenodd"
d="M.894 5.095h11.71L9.386 1.878A.885.885 0 1 1 10.638.626l4.655 4.656a1 1 0 0 1 0 1.414l-4.655 4.656A.885.885 0 1 1 9.386 10.1l3.218-3.217H.894a.894.894 0 0 1 0-1.788Z"/>
</svg>
</div>
</div>
</div>
{# Do not iterate gallery block twice in editmode as this breaks pimcore admin editmode.
Pimcore will try and create two gallery items and this results in a name conflict. #}
{% if not editmode %}
<div class="absolute z-20 hidden gap-2 ml-4 -mt-16 md:inline-flex">
{% if pimcore_block('gallery').getCount() %}
{% for gallery in pimcore_block('gallery').iterator %}
<div data-id="{{ gallery-1 ?? "0" }}" class="cursor-pointer swiper-thumbnail">
{{ pimcore_image('image',
{
'thumbnail': 'gallery-navigation',
'pictureAttributes': {
class: 'overflow-hidden inline-block w-10 h-10 rounded-md md:w-20 md:h-20 aspect-square'
},
'imgAttributes': {
class: 'w-full h-full object-cover object-center'
}
}
) }}
</div>
{% endfor %}
{% endif %}
{% if pimcore_block('gallery').isEmpty()
and defaultGalleryItems is defined %}
{% for image in defaultGalleryItems %}
<div data-id="{{ loop.index0 }}" class="cursor-pointer swiper-thumbnail">
{{ image.thumbnail('gallery-navigation').html(
{
'pictureAttributes': {
class: 'overflow-hidden inline-block w-10 h-10 rounded-md md:w-20 md:h-20 aspect-square'
},
'imgAttributes': {
class: 'w-full h-full object-cover object-center'
}
}
)|raw }}
</div>
{% endfor %}
{% endif %}
</div>
{% endif %}
{% endif %}