{% set orientation = app.request.get('orientation', 'square') %}
{% if editmode %}
{{ include('Layout/includes/css.html.twig') }}
<div class="editmode-box editmode-box--info">
<div class="editmode-box__header">Settings</div>
{{ pimcore_image("teaser_image", {
thumbnail: 'content-teaser--' ~ orientation,
imgAttributes: {
class: 'js-lazy-img embed-responsive-item teaser-animation__img'
},
lowQualityPlaceholder: true,
}) }}<br>
<label>Title: </label>
{{ pimcore_input('title') }}
<label>Subitle: </label>
{{ pimcore_input('subtitle') }}
<label>Badge: </label>
{{ pimcore_input('badgetext') }}
<label>Link: </label>
{{ pimcore_link('link') }}
</div>
{% else %}
<section class="content-teaser content-teaser--{{ orientation }} stretch-link teaser-animation">
<figure class="content-teaser__embed--{{ orientation }} embed-responsive mb-0">
{% if not pimcore_image('teaser_image').empty %}
{% set description = getImageDescription(pimcore_image('teaser_image').image) %}
{{ pimcore_image('teaser_image').image.thumbnail('content-teaser--' ~ orientation).html({
imgAttributes: {
class: 'js-lazy-img embed-responsive-item',
title: description|default(''),
alt: description|default(''),
},
lowQualityPlaceholder: false,
})|raw }}
{# {% if description %}#}
{# <figcaption class="content-teaser__caption">#}
{# {{ description }}#}
{# </figcaption>#}
{# {% endif %}#}
{% endif %}
{% do jsConfig().add('lazyImg', true) %}
</figure>
<div class="content-teaser__content">
<div>
{% if not pimcore_input('badgetext').empty and not app.request.get('removeBadge', false) %}
<div class="content-teaser__badge">
{{ pimcore_input('badgetext').data }}
</div>
{% endif %}
{% if not pimcore_input('subtitle').empty %}
<div class="content-teaser__sub-title">
{{ pimcore_input('subtitle').data }}
</div>
{% endif %}
{% if not pimcore_input('title').empty %}
<h3 class="content-teaser__title h5">
{% if pimcore_link('link').empty ? '' : pimcore_link('link').href|slice(0, 4)|lower == 'http' %}
<a href="{{ pimcore_link('link').empty ? '' : pimcore_link('link').href }}"
{% if not pimcore_link('link').empty and pimcore_link('link').target %}
target="{{ pimcore_link('link').target }}"
{% endif %}
class="stretch-link__link" title="{{ description|default('') }}" data-event-tracking-category="LP Partnerteaser STT" data-event-tracking-action="{{ hostUrl() ~ getMainRequest().pathInfo() }}" data-event-tracking-label="{{ pimcore_link('link').empty ? '' : pimcore_link('link').href }}">
{{ pimcore_input('title').data }}
</a>
{% else %}
<a href="{{ pimcore_link('link').empty ? '' : pimcore_link('link').href }}"
{% if not pimcore_link('link').empty and pimcore_link('link').target %}
target="{{ pimcore_link('link').target }}"
{% endif %}
class="stretch-link__link" title="{{ description|default('') }}">
{{ pimcore_input('title').data }}
</a>
{% endif %}
</h3>
{% endif %}
</div>
</div>
</section>
{% endif %}