templates/includes/blocks/teaser-grid.html.twig line 1
<div class="teaser-grid {% if content.inverted %}teaser-grid--inverted {% endif %}{{ content.top }}
{{ content.bottom }}" x-data="teasergrid({{ content.pages|length }},{{ content.initialItems }},3)">
<div class="teaser-grid__container">
<div class="teaser-grid__title " x-ref="title">
{% if content.teaserGridPagina %}
{% if content.teaserGridSeoHeadlinePagina %}<{{ content.teaserGridSeoHeadlinePagina }}>{% endif %}
<div class="pagina">
{{ content.teaserGridPagina }}
</div>
{% if content.teaserGridSeoHeadlinePagina %}</{{ content.teaserGridSeoHeadlinePagina }}>{% endif %}
{% endif %}
{% if content.teaserGridTitleDesktop %}
<div {% if content.teaserGridTitleMobile %}class="desktop-only"{% endif %}>
{{ content.teaserGridTitleDesktop|raw }}
</div>
{% endif %}
</div>
{% if content.teaserGridTitleMobile %}
<div class="teaser-grid__title mobile-only"
x-ref="mobiletitle">
{{ content.teaserGridTitleMobile|raw }}
</div>
{% endif %}
<div class="teaser-grid__teasers" x-ref="teasers" id="teasers">
{% for key, value in content.pages %}
<a href="{{ sulu_content_path(value.url) }}"
class="story-teaser {% if content.inverted %}story-teaser--inverted {% endif %}"
x-show="show({{ key }})">
<div class="story-teaser__media">
{% if value.excerptAlternativeImage %}
{% set image=value.excerptAlternativeImage %}
<img src ="{{ image|thumbnailUrl('2880x') }}" class="story-teaser__image"
srcset ="{{ image|thumbnailUrl('320x') }} 320w, {{ image|thumbnailUrl('640x') }} 640w, {{ image|thumbnailUrl('1280x') }} 1280w, {{ image|thumbnailUrl('1440x') }} 1440w, {{ image|thumbnailUrl('2048x') }} 2048w" alt="{{ image.description|striptags }}"
x-ref="image" sizes="(min-width: 1440px) 480px, (min-width: 768px) 33vw, 100vw">
{% endif %}
{% if value.excerptImages and not value.excerptAlternativeImage %}
{% set image=value.excerptImages[0] %}
<img src ="{{ image|thumbnailUrl('2880x') }}" class="story-teaser__image"
srcset ="{{ image|thumbnailUrl('320x') }} 320w, {{ image|thumbnailUrl('640x') }} 640w, {{ image|thumbnailUrl('1280x') }} 1280w, {{ image|thumbnailUrl('1440x') }} 1440w, {{ image|thumbnailUrl('2048x') }} 2048w" alt="{{ image.description|striptags }}"
x-ref="image" sizes="(min-width: 1440px) 480px, (min-width: 768px) 33vw, 100vw">
{% endif %}
</div>
<div class="story-teaser__meta">
{% if value.excerptType %}
<span class="story-teaser__type"
style="float: left">{{ value.excerptType }} | </span>
{% endif %}
{% if value.excerptTime %}
<span class="story-teaser__time"><p>{{ value.excerptTime }}</span>
{% endif %}
</div>
{% if value.excerptTitleTeaserGrid %}
<div class="story-teaser__title">
{{ value.excerptTitleTeaserGrid|raw }}
</div>
{% else %}
<div class="story-teaser__title">
{{ value.title|raw }}
</div>
{% endif %}
<div class="story-teaser__text">
{% if value.excerptCustomText %}
{{ value.excerptCustomText|raw }}
{% elseif value.excerptDescription %}
{% set short = value.excerptDescription|split(' ') %}
{% if short|length > 20 %}
{{ short|slice(0, 19)|join(' ')|raw }}...
{% else %}
{{ value.excerptDescription|raw }}
{% endif %}
{% endif %}
</div>
</a>
{% endfor %}
</div>
{# button below has to be shown only as long as not all teasers are shown, not yet working #}
<div class="teaser-grid__actions" x-ref="actions" x-show="showActions()" id="teasergrid-actions">
<button class="button button--{% if content.inverted %}grey{% else %}default {% endif %}"
x-ref="loadmore" @click="loadMore" id="moreButton">
<span class="button__inner">
{{ content.teaserGridExpandButtonLabel }}
</span>
</button>
</div>
</div>
</div>