{% if editmode %}
<div class="bg-gray-100 p-5 wysiwyg-heading">
{% include 'areaHeadAndFooter.html.twig' with { 'header': 'STWH: Teaser-Slider' } %}
{% include 'padding.html.twig' %}
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-1/2 overflow-hidden pr-3">
{% include 'color-selector.html.twig' with { 'name': 'color', 'description': 'Hintergrundfarbe der Box' } %}
</div>
<div class="w-1/4 overflow-hidden pl-3">
Darstellung:
</div>
<div class="w-1/4 overflow-hidden">
{{ pimcore_select("darstellung", {
"store": [
["one", "Ein Teaser über volle Breite"],
["two", "Zwei Teaser nebeneinander"]
],
"defaultValue" : "two"
}) }}
</div>
</div>
{% set block = pimcore_block('gridblock', {'manual' : true, 'default' : 2}).start() %}
{% for b in block.iterator %}
{% do block.blockConstruct() %}
{% do block.blockStart() %}
{% set azz = '' %}
{% if pimcore_select("bullets").getData() != '' %}
{% set azz = pimcore_select("bullets").getData() %}
{% set azzColor = pimcore_select("bulletColor").getData() %}
{% if azzColor is empty %}
{% set azzColor = 'stwh-rot-2024' %}
{% endif %}
{% endif %}
<div class="border border-gray-400 p-3">
<p class="text-gray-400">Element: {{ (b+1) }}</p>
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-1/2 overflow-hidden pr-3">
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-full overflow-hidden">
<p>Teaser-Überschrift: {{ pimcore_textarea("headline_box", { 'height': 60}) }}</p>
</div>
</div>
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-1/4 overflow-hidden">
SEO:
</div>
<div class="w-1/4 overflow-hidden">
{% include 'seo.html.twig' with { 'name': 'seo2', 'default' : 'h3' } %}
</div>
<div class="w-2/4 overflow-hidden">
{% include 'color-selector.html.twig' with { 'name': 'seoHeadlineColor', 'description': 'Farbe der Überschrift', 'type': 'accordeon' } %}
</div>
</div>
<hr />
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-full overflow-hidden {{ azz }} list-{{ azzColor }}">
Teasertext:
{{ pimcore_wysiwyg("teaser_box", { 'height': 100 }) }}
{% include 'bullet-points.html.twig' with { 'name': 'bullets', 'description': 'Aufzählungszeichen' } %}
{% include 'color-selector.html.twig' with { 'name': 'bulletColor', 'description': 'Farbe der Bullets', 'default': 'stwh-rot-2024' } %}
</div>
</div>
<hr/>
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-1/2 overflow-hidden">
Teaserlink:
</div>
<div class="w-1/2 overflow-hidden">
{{ pimcore_link("teaser_link") }}
</div>
</div>
<hr/>
<div class="my-3 flex flex-wrap overflow-hidden">
<div class="w-3/4 overflow-hidden">
Soll die Überschrift unterstrichen werden?
</div>
<div class="w-1/4 overflow-hidden">
{{ pimcore_checkbox("hasDivider") }} JA
</div>
<div class="w-1/2 overflow-hidden">
{% include 'color-selector.html.twig' with { 'name': 'headline-divider-color', 'description': 'Farbe vom Unterstrich', 'default': 'stwh-rot-2024' } %}
</div>
</div>
</div>
<div class="w-1/2 overflow-hidden pl-3">
Teaser-Bild:
{{ pimcore_image("bild_box", {
"height": 400
}) }}
</div>
</div>
</div>
{% do block.blockEnd() %}
{% do block.blockDestruct() %}
{% endfor %}
{% do block.end() %}
</div>
{% include 'areaHeadAndFooter.html.twig' with { 'footer': true } %}
{% else %}
{% set darstellung = pimcore_select("darstellung").getData() %}
<section
class="wysiwyg-heading {{ pimcore_select('paddingTop') }} {{ pimcore_select('paddingBottom') }} relative bg-{{ pimcore_select('color') }}">
<div class="container mx-auto px-5 overflow-hidden">
{# Ein Teaser-Slider über volle Breite #}
{% if darstellung == 'one' %}
<div class="teaserslider-full">
<div class="swiper-wrapper">
{% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
{% for b in block.iterator %}
{% do block.blockConstruct() %}
{% do block.blockStart() %}
{% set seo2 = pimcore_select("seo2").getData() %}
{% set azz = '' %}
{% if pimcore_select("bullets").getData() != '' %}
{% set azz = pimcore_select("bullets").getData() %}
{% set azzColor = pimcore_select("bulletColor").getData() %}
{% if azzColor is empty %}
{% set azzColor = 'stwh-rot-2024' %}
{% endif %}
{% endif %}
<div class="flex flex-wrap overflow-hidden swiper-slide {{ azz }} list-{{ azzColor }}">
<div class="w-full lg:w-1/2 lg:pr-5">
<img data-src="{{ pimcore_image("bild_box", {
format: 'webp'
}).getThumbnail('teaser-bild') }}"
alt="{{ pimcore_image("bild_box").getAlt() }}"
title="{{ pimcore_image("bild_box").getAlt() }}"
class="swiper-lazy rounded-lg"/>
</div>
<div class="w-full lg:w-1/2 lg:pl-5 text-lg">
{% set bordy = '' %}
{% set borderColor = pimcore_select('headline-divider-color').getData() %}
{% if pimcore_checkbox('hasDivider').isChecked() %}
{% set bordy = 'border-b-2 pb-2 border-' ~ borderColor %}
{% endif %}
<{{ seo2 }} class="text-{{ pimcore_select("seoHeadlineColor").getData() }} block py-5 font-bold lg:text-4xl md:text-3xl sm:text-xl {{ bordy }}
">{{ pimcore_textarea("headline_box")|nl2br }}</{{ seo2 }}>
{{ pimcore_wysiwyg("teaser_box") }}
{% if pimcore_link("teaser_link") != '' %}
{% include 'widgets/morelink.html.twig' with {name: 'teaser_link' } %}
{% endif %}
</div>
</div>
{% do block.blockEnd() %}
{% do block.blockDestruct() %}
{% endfor %}
{% do block.end() %}
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need navigation buttons -->
<div class="invisible lg:visible swiper-button-prev"></div>
<div class="invisible lg:visible swiper-button-next"></div>
</div>
{% endif %}
{# Zwei Teaser-Slider nebeneinander #}
{% if darstellung == 'two' %}
<div class="teaserslider">
<div class="swiper-wrapper">
{% set block = pimcore_block('gridblock', {'manual' : true}).start() %}
{% for b in block.iterator %}
{% do block.blockConstruct() %}
{% do block.blockStart() %}
{% set seo2 = pimcore_select("seo2").getData() %}
{% set azz = '' %}
{% if pimcore_select("bullets").getData() != '' %}
{% set azz = pimcore_select("bullets").getData() %}
{% set azzColor = pimcore_select("bulletColor").getData() %}
{% if azzColor is empty %}
{% set azzColor = 'stwh-rot-2024' %}
{% endif %}
{% endif %}
<div class="swiper-slide {{ azz }} list-{{ azzColor }} text-lg">
<div class="aspect-[3/2]">
<img class="object-cover swiper-lazy rounded-lg"
data-src="{{ pimcore_image("bild_box", {
format: 'webp'
}).getThumbnail('teaser-bild') }}"
alt="{{ pimcore_image("bild_box").getAlt() }}"
title="{{ pimcore_image("bild_box").getAlt() }}"
/>
</div>
<{{ seo2 }} class="text-{{ pimcore_select("seoHeadlineColor").getData() }} block py-5 font-bold lg:text-5xl md:text-4xl
sm:text-2xl">{{ pimcore_textarea("headline_box")|nl2br }}</{{ seo2 }}>
{{ pimcore_wysiwyg("teaser_box") }}
{% if pimcore_link("teaser_link") != '' %}
{% include 'widgets/morelink.html.twig' with {name: 'teaser_link' } %}
{% endif %}
</div>
{% do block.blockEnd() %}
{% do block.blockDestruct() %}
{% endfor %}
{% do block.end() %}
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need navigation buttons -->
<div class="invisible lg:visible swiper-button-prev"></div>
<div class="invisible lg:visible swiper-button-next"></div>
</div>
{% endif %}
</div>
</section>
{% endif %}