{% set sliderBlockName = 'sliderBlockName' %}
{% set amount = pimcore_block(sliderBlockName).getCount() - 1 %}
<div class="container-fluid {% if amount > -1 %}hero{% endif %} hero-default mb-5">
{% if editmode %}
<div class="d-block my-5 py-5"></div>
<div class="hero-overlay"></div>
{% endif %}
{% if editmode %}
<div class="container">
{% set message = 'Slideshow: druk op + om een slide toe te voegen' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : 'info'} %}
{% set block = pimcore_block(sliderBlockName, {'reload' : true, 'limit' : 6}) %}
{% for blockcontent in block.iterator %}
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-6">
{% set message = 'Afbeelding' %}
{% set type = 'info' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : type} %}
{{ pimcore_image('homepage_top_image', {
'class': 'img-fluid' }) }}
</div>
<div class="col-6">
{% set message = 'Titel' %}
{% set type = 'info' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : type} %}
<div class="col-auto mb-3">
{{ pimcore_select("titleColor", {
"store": [
["text-primary", "primary"],
["text-secondary", "secondary"],
["text-red", "red"],
["text-black", "black"],
["text-white", "white"]
],
"reload" : true,
"defaultValue" : "1",
}) }}
</div>
{{ pimcore_textarea('homepage_top_titel',{
"nl2br": true,
"height": 100,
}) }}
{% set message = 'Inhoud' %}
{% set type = 'info' %}
{% include 'includes/basicBlocks/admin/message/tip.html.twig' with {'message': message, 'type' : type} %}
{{ pimcore_wysiwyg('homepage_top_inhoud') }}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{# // Set titleColor #}
{% set titleColor = pimcore_select("titleColor").getData() %}
{% if not editmode %}
{% set blocks = pimcore_block(sliderBlockName, {'limit' : 6}) %}
{% if amount < 0 %}
<div class="d-block my-5 py-5"></div>
{% endif %}
<div class="row">
<div class="col-12 col-lg-8 p-0 pe-lg-5" {#data-aos="fade-right"#}>
<div class="mask-image position-relative">
<div id="{{ sliderBlockName }}" class="carousel slide carousel-sync" data-bs-ride="carousel">
{% if amount > 1 %}
<ul class="carousel-indicators m-0 mb-3">
{% for i in 0..amount %}
<li type="button" data-bs-target="#{{ sliderBlockName }}" data-bs-slide-to="{{ i }}"
class="{% if i == 0 %}active{% endif %}"
aria-current="{% if i == 0 %}true{% endif %}" aria-label="Slide {{ i }}"></li>
{% endfor %}
</ul>
{% endif %}
<div class="carousel-inner">
{% for block in blocks.iterator %}
{% set current = blocks.getCurrent() %}
<div class="carousel-item {% if current == 0 %}active{% endif %}">
<img src="{{ pimcore_image('homepage_top_image').getThumbnail('homepage-top') }}">
</div>
{% endfor %}
</div>
</div>
</div>
</div>
<div class="hero-content">
<div id="{{ sliderBlockName }}-B" class="carousel slide carousel-sync"
data-bs-ride="carousel">
<div class="carousel-inner">
{% for block in blocks.iterator %}
{% set current = blocks.getCurrent() %}
<div class="carousel-item {% if current == 0 %}active{% endif %}">
<div class="container">
<div class="row">
<div class="col"></div>
<div class="col-12 col-lg-9 col-md-8 align-self-end" {#data-aos="fade-left"#}>
<div class="text-end ps-3 ps-lg-5 pe-3 pe-lg-0">
<div class="h-100 py-5">
<h1 class="display-1 {{ pimcore_select("titleColor").getData() }}">{{ pimcore_textarea('homepage_top_titel',{
"nl2br": true,
}) }}</h1>
<div class="text-black w-50 float-end">
{{ pimcore_wysiwyg('homepage_top_inhoud') }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{#
{% if amount > 1 %}
<a class="carousel-control-prev" href="#{{ sliderBlockName }}" role="button"
data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">{{ 'Previous'|trans }}</span>
</a>
<a class="carousel-control-next" href="#{{ sliderBlockName }}" role="button"
data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">{{ 'Next'|trans }}</span>
</a>
{% endif %}#}
</div>
{# </div>r#}
</div>
</div>
{% endif %}
</div>
<script>
$('.carousel-sync').on('slide.bs.carousel', function (ev) {
// get the direction, based on the event which occurs
var dir = ev.direction == 'right' ? 'prev' : 'next';
// get synchronized non-sliding carousels, and make'em sliding
$('.carousel-sync').not('.sliding').addClass('sliding').carousel(dir);
});
$('.carousel-sync').on('slid.bs.carousel', function (ev) {
// remove .sliding class, to allow the next move
$('.carousel-sync').removeClass('sliding');
});
// sync clicks on carousel-indicators as well
$('.carousel-indicators li').click(function (e) {
e.stopPropagation();
var goTo = $(this).data('slide-to');
$('.carousel-sync').not('.sliding').addClass('sliding').carousel(goTo);
});
</script>