<section class="area-gallery-carousel">
{% set selectStore = [] %}
{% for i in 2..29 %}
{% set selectStore = selectStore|merge([i]) %}
{% endfor %}
{% set slidesSelect = pimcore_select('slides', {
store: selectStore,
reload: true,
width: 70,
class: 'align-middle'
}) %}
{% set showPreviewsCheckbox = pimcore_checkbox('showPreviews', {class: 'align-middle pt-7px'}) %}
{% set showPreviews = showPreviewsCheckbox.isChecked and not editmode %}
{% set id = 'gallery-carousel-' ~ uniqid() %}
{% set slides = slidesSelect.getData()|default(2) %}
{% if editmode %}
<div class="alert alert-secondary col-xs-12" style="height: 75px">
<div class="col-xs-6 d-inline mx-auto">
<span class="editmode-label align-middle">How many images you want to show?</span>
{{ slidesSelect|raw }}
</div>
<div class="col-xs-6 d-inline ml-5">
<span class="editmode-label align-middle">Show Previews</span>
{{ showPreviewsCheckbox|raw }}
</div>
</div>
{% endif %}
<div id="{{ id }}" class="gallery carousel slide" data-ride="carousel" {{ editmode ? 'data-interval="false"' : '' }}>
<!-- Indicators -->
<ol class="carousel-indicators {{ showPreviews ? 'preview visible-lg' }}">
{% for i in 0..(slides-1) %}
<li data-target="#{{ id }}" data-slide-to="{{ i }}" class="{{ loop.first ? 'active' }}">
{% if showPreviews %}
{{
pimcore_image('image_' ~ i, {
thumbnail: 'galleryCarouselPreview',
})
}}
{% endif %}
</li>
{% endfor %}
</ol>
<div class="carousel-inner">
{% for i in 0..(slides-1) %}
<div class="carousel-item {{ id ~ '-' ~ i }} {{ loop.first ? 'active' }}">
{{
pimcore_image('image_' ~ i, {
thumbnail: 'galleryCarousel',
hidetext: true,
dropClass: id ~ '-' ~ i,
imgAttributes: {class: 'd-block w-100'}
})
}}
<div class="carousel-caption text-center {{ showPreviews ? 'vh-10' : ''}}">
<h3>{{ pimcore_input('caption-title_' ~ i) }}</h3>
<p class="hero-text">{{ pimcore_textarea('caption-text' ~ i) }}</p>
<p>{% set cLink = pimcore_link('caption-link' ~ i, {
'class': 'btn btn-lg btn-primary'
}) %}
{{ cLink|raw }}
</p>
</div>
</div>
{% endfor %}
</div>
<a class="carousel-control carousel-control-prev" href="#{{ id }}" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control carousel-control-next" href="#{{ id }}" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</section>