{# You can pass `media` as an ImageGallery data object. #}
{% set gallery = pimcore_block('gallery', { 'reload': true }) %}
{% embed 'app/area-brick-layout.html.twig' %}
{% block content %}
{% if editmode %}
<section class="container">
{% if (media ?? null) is empty and gallery.isEmpty() %}
{% embed 'app/editmodenotice.html.twig' %}
{% block title %} Er is nog geen media toegevoegd. {% endblock %}
{% block information %}
{# is defined will also return true if media value is `null`. #}
{% if media is defined %}
Je kunt media toevoegen binnen het Data Object.
{% else %}
Klik op de groene plus om een media slide toe te voegen.
{% endif %}
{% endblock %}
{% endembed %}
{% endif %}
{% if media is not defined %}
{% for image in gallery.iterator %}
<div class="grid grid-cols-2">
<div>
Kies een afbeelding,
{{ pimcore_image('image', {
'thumbnail': 'media-brick-image-thumbnail',
'reload': 'false',
'class':'w-full',
'pictureAttributes': {class: 'w-full'}
}) }}
</div>
<div>
óf kies een video.
{{ pimcore_video('video', {
thumbnail: 'media-brick-video-thumbnail',
width: 1280,
height: 720,
youtube: {
autoplay: false,
modestbranding: true
},
vimeo: {
autoplay: false,
loop: false,
}
}) }}
</div>
</div>
{% endfor %}
{% endif %}
</section>
{% endif %}
{# If `media` is passed, always render it (also in editmode). #}
{# If `media` is not passed, only render in frontend (not in editmode)
because above pimcore_block grid will suffice when in editmode. #}
{% if (media ?? null) is not empty or (not editmode and not gallery.isEmpty()) %}
{% set title = '' %}
{% set count = media is defined ? (media | length) : gallery.count %}
<section class="container">
<div class="relative -mx-5 md:mx-0 {{ count == 1 ? 'md:pb-8' : 'md:pb-28' }}">
<div class="swiper !mx-5 md:!mx-0 -mb-[165px] md:mb-0 rounded-md !z-20 {{ count > 1 ? 'media-swiper' : '' }}">
<div class="relative swiper-wrapper rounded-t-md md:rounded-md">
{% if media is defined %}
{% for m in media %}
{% if (m is defined and m is not null) %}
{% set title = m.image.getMetadata('title')|default %}
<div class="swiper-slide" data-caption="{{ title }}">
{{ m.getThumbnail('media-brick-image-thumbnail').html({
class:'w-full',
pictureAttributes: {class: 'w-full rounded-t-md aspect-square md:aspect-auto md:rounded-md block overflow-hidden'},
imgAttributes: {class: 'w-full h-full object-cover object-center'},
}) | raw }}
</div>
{% endif %}
{% endfor %}
{% else %}
{% for image in gallery.iterator %}
{% set image = pimcore_image('image', {
thumbnail: 'media-brick-image-thumbnail',
reload: true,
class:'w-full',
pictureAttributes: {class: 'w-full rounded-t-md aspect-square md:aspect-auto md:rounded-md block overflow-hidden'},
imgAttributes: {class: 'w-full h-full object-cover object-center'},
}) %}
{% if not image.isEmpty() %}
{% set title = image.getText() %}
<div class="swiper-slide" data-caption="{{ title }}">
{{ image|raw }}
</div>
{% else %}
{% set video = pimcore_video('video', {
thumbnail: 'media-brick-video-thumbnail',
youtube: {
autoplay: true,
modestbranding: true
},
vimeo: {
autoplay: true,
loop: true
},
}) %}
{% set title = video.getTitle() %}
<div class="swiper-slide" data-caption="{{ title }}">
{{ video|raw }}
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div><!--./swiper-->
<div
class="flex items-end z-10 h-[320px] md:h-[320px] md:absolute md:-mr-10 bg-blue-200 px-5 py-6 md:px-10 md:py-8 w-full placeholder-gray-200 md:rounded-md md:-bottom-0 md:-right-0">
<div class="flex flex-col items-center justify-between w-full md:flex-row">
{% if count > 1 %}
<div class="mb-6 media-swiper-caption md:mb-0" data-caption-show>
<!-- empty -->
</div>
{% elseif count === 1 %}
{{ title }}
{% endif %}
{% if count > 1 %}
<div class="flex flex-col items-center w-full md:flex-row md:w-auto">
<div class="!w-auto -mb-8 md:mb-0 md:mr-10 media-swiper-pagination project-media-swiper-pagination"></div>
<div class="flex justify-end md:justify-between flex-grow w-full md:w-auto">
<div class="mr-2 media-swiper-button-prev media-swiper-button-project-media">
<svg class="rotate-180" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="23.5857104px" height="16.8675464px" viewBox="0 0 23.5857104 16.8675464" version="1.1">
<g id="case-study" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="coolworld-project-case-study-vd-1504-v02" transform="translate(-1580.000000, -1967.550069)" fill="#0072BB">
<g id="media" transform="translate(0.000000, 1270.000000)">
<g id="Group-2" transform="translate(426.000000, 449.000000)">
<g id="components/navigation/mobile/carousel" transform="translate(1014.000000, 245.000000)">
<g id="icons/ui/arrow-line-right" transform="translate(140.000000, 3.000000)">
<path d="M22.6587309,7.6425728 L5.09460875,7.6425728 L5.09460875,7.6425728 L9.92142843,2.81683065 C10.4400119,2.29836292 10.4401058,1.4576668 9.92163804,0.939083306 C9.92160311,0.939048366 9.92156818,0.939013428 9.92153324,0.938978492 C9.40298689,0.420432142 8.56225714,0.420432142 8.0437108,0.938978492 C8.04368837,0.939000914 8.04366595,0.939023337 8.04364353,0.939045761 L0.70705612,8.27668449 C0.316700705,8.6672985 0.316700705,9.30038534 0.70705612,9.69099936 L8.04364353,17.0286381 C8.56215273,17.5472216 9.40288247,17.5472818 9.92146597,17.0287726 C9.9214884,17.0287502 9.92151082,17.0287278 9.92153324,17.0287054 C10.4400589,16.5101797 10.4400589,15.6694836 9.92153324,15.150958 C9.9214983,15.1509231 9.92146337,15.1508881 9.92142843,15.1508532 L5.09460875,10.3251111 L5.09460875,10.3251111 L22.6587309,10.3251111 C23.3994934,10.3251111 24,9.72460441 24,8.98384192 C24,8.24307944 23.3994934,7.6425728 22.6587309,7.6425728 Z" id="arrow-line-right" transform="translate(12.000000, 8.983842) scale(-1, 1) translate(-12.000000, -8.983842) "/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
<div class="media-swiper-button-next media-swiper-button-project-media">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="23.5857104px" height="16.8675464px" viewBox="0 0 23.5857104 16.8675464" version="1.1">
<g id="case-study" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="coolworld-project-case-study-vd-1504-v02" transform="translate(-1580.000000, -1967.550069)" fill="#0072BB">
<g id="media" transform="translate(0.000000, 1270.000000)">
<g id="Group-2" transform="translate(426.000000, 449.000000)">
<g id="components/navigation/mobile/carousel" transform="translate(1014.000000, 245.000000)">
<g id="icons/ui/arrow-line-right" transform="translate(140.000000, 3.000000)">
<path d="M22.6587309,7.6425728 L5.09460875,7.6425728 L5.09460875,7.6425728 L9.92142843,2.81683065 C10.4400119,2.29836292 10.4401058,1.4576668 9.92163804,0.939083306 C9.92160311,0.939048366 9.92156818,0.939013428 9.92153324,0.938978492 C9.40298689,0.420432142 8.56225714,0.420432142 8.0437108,0.938978492 C8.04368837,0.939000914 8.04366595,0.939023337 8.04364353,0.939045761 L0.70705612,8.27668449 C0.316700705,8.6672985 0.316700705,9.30038534 0.70705612,9.69099936 L8.04364353,17.0286381 C8.56215273,17.5472216 9.40288247,17.5472818 9.92146597,17.0287726 C9.9214884,17.0287502 9.92151082,17.0287278 9.92153324,17.0287054 C10.4400589,16.5101797 10.4400589,15.6694836 9.92153324,15.150958 C9.9214983,15.1509231 9.92146337,15.1508881 9.92142843,15.1508532 L5.09460875,10.3251111 L5.09460875,10.3251111 L22.6587309,10.3251111 C23.3994934,10.3251111 24,9.72460441 24,8.98384192 C24,8.24307944 23.3994934,7.6425728 22.6587309,7.6425728 Z" id="arrow-line-right" transform="translate(12.000000, 8.983842) scale(-1, 1) translate(-12.000000, -8.983842) "/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div><!--/.relative-->
</section>
{% endif %}
{% endblock %}
{% endembed %}