{% set prefix = prefix is defined and prefix != '' ? prefix ~ '-' : '' %}
<div class="card-teaser {{ className |default(null) }} stretch-link">
{% if tag|default('') %}
<span class="card-teaser__tag">
{{ tag }}
</span>
{% endif %}
{% if editmode %}
{{ pimcore_image(prefix ~ 'image', { 'thumbnail': 'ticket-teaser' }) }}
{% endif %}
{% set image = image|default('') ?: pimcore_image(prefix ~ 'image').empty ? null : pimcore_image(prefix ~ 'image').image %}
{% if image %}
<div class="ratio ratio-ticket-teaser img-scroll-zoom-wrapper">
{% block image %}
{{ image.thumbnail('ticket-teaser').getHtml({
'imgAttributes': {
'class': 'ratio-item card-teaser__img js-img-scroll-zoom img-scroll-zoom js-lazy-img'
},
'lowQualityPlaceholder': true
})|raw }}
{% endblock %}
</div>
{% endif %}
<div class="card-teaser__body">
{% if editmode or toptitle|default('') or not pimcore_input(prefix ~ 'toptitle').empty %}
<div class="card-teaser__top-title">
{{ toptitle|default('')|raw ?: pimcore_input(prefix ~ 'toptitle', { 'placeholder': 'Top Title' })|raw }}
</div>
{% endif %}
{% if editmode or title|default('') or not pimcore_input(prefix ~ 'title').empty %}
<h3 class="card-teaser__title">
{{ title|default('')|raw ?: pimcore_input(prefix ~ 'title', { 'placeholder': 'Title' })|raw }}
</h3>
{% endif %}
{% if editmode or text|default('') or not (pimcore_textarea(prefix ~ 'text') and pimcore_textarea(prefix ~ 'text').empty) %}
<div class="card-teaser__text wysiwyg">
{{ text|default('')|raw ?: pimcore_textarea(prefix ~ 'text', { 'placeholder': 'Text' })|raw }}
</div>
{% endif %}
{% if editmode %}
{{ pimcore_link(prefix ~ 'link', { 'class': 'card-teaser__link mt-auto stretch-link__link' }) }}
{% else %}
{% set link = link|default('') ?: pimcore_link(prefix ~ 'link') %}
{% if link.href %}
{% if useRedButton|default(false) %}
<a href="{{ link.href }}" target="{{ link.target }}" class="btn btn-tertiary mt-3 w-100" data-event-tracking-key="card-teaser-{{ key | default }}">
{{ link.text }}
</a>
{% else %}
<a href="{{ link.href }}" target="{{ link.target }}" class="card-teaser__link mt-auto stretch-link__link" data-event-tracking-key="card-teaser-{{ key | default }}">
{{ link.text }}
<span class="icon icon-arrow-right card-teaser__icon"></span>
</a>
{% endif %}
{% endif %}
{% endif %}
</div>
</div>
{#ToDo CMS: enter correct teaser title and click url for every teaser #}
{% set trackingKey = 'card-teaser-' ~ key | default %}
{% set trackingData = {
"trigger": "click",
"datalayer": {
"event": "product_teaser_click",
"teaser_title": title.text | default,
"click_url": link.href | default,
}
} %}
{% do jsConfig('_trackingData').add({
(trackingKey): trackingData
}) %}