{% set heroType = heroType|default('') ?: pimcore_select('heroType').data %}
{% set siteConfig = getSiteConfig() %}
{% embed 'includes/editmode-box.html.twig' %}
{% block editmodeSettings %}
<div class="row">
<div class="col" style="z-index: 1000">
<b>Hero Image:</b> {{ pimcore_image('image', {
'width': 100,
'required': true
}) }}
</div>
<div class="col">
<b>Hero Type:</b><br>
{{ pimcore_select('heroType', {
'store': [
[ 'standard', 'Simple Hero' ],
[ 'fullWidth', 'Full Width' ],
[ 'fullWidthAndBigClouds', 'Full Width + More Clouds (default)' ],
],
'width': 300,
'defaultValue': 'fullWidthAndBigClouds',
'reload': true
}) }}<br>
</div>
{% if heroType == 'fullWidth' or heroType == 'fullWidthAndBigClouds' %}
<div class="col">
{{ pimcore_checkbox('countdown', {
'label': 'Show Countdown?',
'reload': true
}) }}<br>
{% if pimcore_checkbox('countdown').checked %}
<b>End Time <small>Format: "2023-03-21T00:00:00+0100"</small></b>
{{ pimcore_input('countdownEndTime', {
'label': '',
'placeholder': '2023-03-21T00:00:00+0100'
}) }}
{% endif %}
</div>
{% endif %}
</div>
{% if useUsps|default(false) %}
{{ pimcore_relations('usps', {
'types' : [ 'object' ],
'subtypes' : { 'object' : [ 'object' ] },
'class': 'Usp',
'title': 'USP Objects',
'limit': 4
}) }}
{% endif %}
{% endblock %}
{% endembed %}
{% set image = image|default(false) ?: pimcore_image('image').empty ? null : pimcore_image('image') %}
{% set thumbnail = getContentHeroThumb(type|default('big')) %}
{% if image %}
{% do elements_opengraph().addImage(image.thumbnail(thumbnail)) %}
{% else %}
{% do elements_opengraph().addImage(getSiteConfig().fallbackImage) %}
{% endif %}
<section class="{{ className|default('') }} content-hero {{ hasGradient|default(false) and not editmode ? 'content-hero--gradient' : '' }}" style="{{ pimcore_image('image') and pimcore_image('image').empty ? 'margin-top:200px;' : '' }}">
{% if image and (heroType == 'fullWidth' or heroType == 'fullWidthAndBigClouds') %}
<div class="content-hero__image">
<figure class="ratio {{ getContentHeroRatio(type|default('big')) }}">
<link rel="preload" href="{{ preload(image.thumbnail(thumbnail).getAsFormat("webp"), { as: 'image', media: '(min-width:768px)' }) }}" as="image" media="(min-width:768px)">
<link rel="preload" href="{{ preload(image.thumbnail(thumbnail).getMedia("(max-width: 767px)", 2).getAsFormat("webp"), { as: 'image', media: '(max-width:767px)' }) }}" as="image" media="(max-width:767px)">
{{ image.thumbnail(thumbnail).getHtml({
'imgAttributes': { 'class': 'ratio-item', 'loading': 'eager', 'data-cookieconsent': 'ignore' },
'lowQualityPlaceholder': true
})|raw }}
{{ image.thumbnail(thumbnail).getHtml({
'imgAttributes': { 'class': 'ratio-item', 'loading': 'eager', 'data-cookieconsent': 'ignore' }
})|raw }}
</figure>
<div class="d-none d-md-block content-hero__clouds {{ heroType == 'fullWidthAndBigClouds' ? '' : 'content-hero__clouds--transparent' }} ratio ratio-hero-clouds ratio-xs-3x2">
{% if siteConfig.clouds %}
{{ siteConfig.clouds.thumbnail('content-hero-clouds').getHtml({
'imgAttributes': {
'class': 'ratio-item content-hero__clouds__img',
'loading': 'eager'
}
})|raw }}
{% endif %}
</div>
<div class="d-md-none content-hero__clouds {{ heroType == 'fullWidthAndBigClouds' ? '' : 'content-hero__clouds--transparent' }} ratio ratio-hero-clouds ratio-xs-3x2">
{% set cloudsMobile = siteConfig.cloudsMobile ?: siteConfig.clouds %}
{% if cloudsMobile %}
{{ cloudsMobile.thumbnail('content-hero-clouds').getHtml({
'imgAttributes': {
'class': 'ratio-item content-hero__clouds__img',
'loading': 'eager'
}
})|raw }}
{% endif %}
</div>
</div>
{% elseif image %}
<div class="container--move-right pe-0">
<div class="content-hero__image--spacing">
<figure class="ratio ratio-3x1 ratio-xs-1x1">
{{ image.thumbnail('content-hero-small').getHtml({
'imgAttributes': {
'class': 'ratio-item',
'loading': 'eager'
},
'lowQualityPlaceholder': true
})|raw }}
{{ image.thumbnail('content-hero-small').getHtml({
'thumbnail': 'content-hero-small',
'imgAttributes': {
'class': 'ratio-item',
'loading': 'eager'
}
})|raw }}
</figure>
</div>
</div>
{% endif %}
<div class="container
{{ (heroType == 'fullWidth' or heroType == 'fullWidthAndBigClouds') and not editmode ? 'content-hero__body--fullwidth' : 'content-hero__body' }}
{{ (heroType == 'fullWidthAndBigClouds') and not editmode ? 'content-hero__body--fullwidth-clouds': '' }}
{{ (heroType == 'fullWidth' or heroType == 'fullWidthAndBigClouds') and not editmode and (useUsps|default(false) or intro|default(false)) ? 'content-hero__body--fullwidth--only-desktop' : '' }}"
>
<div class="row gy-3 gy-md-0 pb-3">
<div class="col-md-6">
{{ include('includes/title-blocks/main-title-block.html.twig', {
'title': title|default(''),
'topTitle': toptitle|default(''),
'toptitleStyle': toptitleStyle|default(''),
'toptitleLink': toptitleLink|default(''),
'toptitleTag': toptitleTag|default('')
}, with_context = false) }}
{% if not hideBreadcrumbs|default(false) %}
{{ breadcrumbHelper() }}
{% endif %}
{% if intro|default(false) %}
<div class="mt-3 mt-md-80 wysiwyg">
{{ pimcore_wysiwyg('heroIntro', { 'placeholder': 'Intro Text' }) }}
</div>
{% endif %}
</div>
{% if pimcore_checkbox('countdown') and pimcore_checkbox('countdown').checked() %}
<div class="col-md-6">
<h3 class="title-block__top-title">
{{ pimcore_input('countdownHeadline', { 'placeholder': 'Überschrift' })}}
</h3>
{{ include('includes/content/countdown.html.twig', { 'endTime': pimcore_input('countdownEndTime') }) }}
</div>
{% endif %}
{% if useUsps|default(false) and not pimcore_relations('usps').empty %}
<div class="col-12">
<div class="row g-3 mt-5 mt-md-80">
{% for usp in pimcore_relations('usps').elements %}
<div class="col-6 col-md-3">
{{ include('includes/content/usp-item.html.twig', {
'usp': usp
}, with_context = false) }}
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>
</section>