-
Notifications
You must be signed in to change notification settings - Fork 4
/
_overview.twig
39 lines (38 loc) · 2.07 KB
/
_overview.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% set class = 'spacer spacer--xsm spacer--med@sml' %}
{% if settings.section is not defined %}
{% if block['backgroundColor'] is defined and block['backgroundColor']|length and block['backgroundColor'] != 'default' %}
{% set class = 'spacer spacer--xsm spacer--med@sml panel panel--' ~block.backgroundColor %}
{% endif %}
{% endif %}
<div class="{{ class }}">
<div class="grid">
{% if block.blockTitle|length %}
<h2>{{ block.blockTitle }}</h2>
{% endif %}
{% for overviewEntry in block.entries.with(['overviewImage']).all() %}
<div class="grid__12 grid__4@med">
<a class="card card--nav card--link" href="{{ overviewEntry.url }}">
<div class="card__content">
<div class="card__img">
{% set optimizedImage = overviewEntry.overviewImage|default(fallback.image)|first.optimizedOverview %}
<img src="{{ optimizedImage.src(660) ?: max(optimizedImage.optimizedImageUrls) }}"
srcset="{{ optimizedImage.srcset() }}"
sizes="(max-width: 819px) 95vw, (min-width: 820px) and (max-width: 979px) 420px, (min-width: 980px) 406px, 440px"
alt="{{ overviewEntry.overviewImage|first().imageCaption ?? overviewEntry.overviewImage|first.title ?? overviewEntry.title }}"
/>
</div>
<div class="card__heading">
<h2>{{ overviewEntry.overviewTitle ?? overviewEntry.title }}</h2>
</div>
<div class="card__body">
{% if overviewEntry.overviewDescription %}
{{ overviewEntry.overviewDescription }}
{% endif %}
<p class="btn btn--read-more">{{ 'Lees meer'|t }}</p>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
</div>