Use the teaser component in a collection to show teasers of content.
The teaser component is used in collections on overview and on filter pages to show the overview of the content with links to the content. The teaser component can also be used in a collection on detail pages to show and link to related content.
Do not use the teaser component as a standalone component. Always use the teaser component in a collection.
A teaser can consist of the following parts:
The entire teaser block is clickable. When clicking the teaser block, the primary teaser link is followed.
The secondary teaser links inside the teaser block are also clickable. When clicking a secondary teaser link, that links is followed. When not clicking on a secondary teaser link but anywhere else in the teaser block, the primary teaser link is followed.
<li class="teaser {% if type %} {{ type }} {% endif %} {% if modifier %} {{ modifier }} {% endif %}">
<article class="teaser-content">
{# title must be the first element in markup #}
<div class="content__second">
<h3>{{ title }}</h3>
{% if tag %}
{% include '@tag' with {
"tag_text": tag,
"type": 'span-tag'
} %}
{% endif %}
{% if tag2 %}
{% include '@tag' with {
"tag_text": tag2,
"type": 'span-tag'
} %}
{% endif %}
{% if address %}
<ul class="icon-list">
<li>
<i class='icon-marker'></i><span><strong> {{ address_location }} </strong> — {{ address }}</span>
</li>
</ul>
{% endif %}
{% if location %}
<div class="location">
<i class="icon-marker" aria-hidden="true"></i><span>{{ location}}</span>
</div>
{% endif %}
{% if list %}
{% include '@list' with {
'type': 'dash-separated-list',
'items': list
} %}
{% endif %}
{% if paragraph_text %}
{% include '@paragraph' with {
'text': paragraph_text
} %}
{% endif %}
{% include '@link' with {
'text': link_text,
'link': link,
'modifier': 'read-more standalone-link',
'title': null,
'hidden_read_more': 'about '~title
} %}
</div>
{% if image_src is defined %}
<div class="content__first">
<div class="figure-wrapper">
{% include '@image' with {
src: image_src,
ratio: '8:5'
} %}
<div class="accolade-inverse right-top"></div>
<div class="accolade-inverse bottom-left"></div>
</div>
</div>
{% endif %}
</article>
<a href="{{ link }}" class="teaser-overlay-link" tabindex="-1"
aria-hidden="true">{{ title }}</a>
</li>
<li class="teaser teaser--wide ">
<article class="teaser-content">
<div class="content__second">
<h3>This is a wide teaser, usually used with the sidebar layout</h3>
<span class="tag ">
Optional tag
</span>
<span class="tag ">
More optional tags
</span>
<ul class="icon-list">
<li>
<i class='icon-marker'></i><span><strong> Lakenhalle </strong> — Botermarkt 18A, 9000 Gent</span>
</li>
</ul>
<ul class="dash-separated-list ">
<li>List item 1</li>
<li>List item 2 is a bit longer</li>
<li>List item 3</li>
<li>List item 4</li>
</ul>
<p class="">This is a wide teaser, usually used with the sidebar layout. It can contain multiple components and has an optional image.</p>
<a href='#' class="read-more standalone-link">
Read more <span class="visually-hidden">
about This is a wide teaser, usually used with the sidebar layout
</span>
</a>
</div>
<div class="content__first">
<div class="figure-wrapper">
<figure>
<div class="image-wrapper" data-ratio="8:5"><img src="https://via.placeholder.com/800x500&text=8:5+(800x500)" alt="" /></div>
</figure>
<div class="accolade-inverse right-top"></div>
<div class="accolade-inverse bottom-left"></div>
</div>
</div>
</article>
<a href="#" class="teaser-overlay-link" tabindex="-1" aria-hidden="true">This is a wide teaser, usually used with the sidebar layout</a>
</li>
{
"image_ratio": "8:5",
"paragraph_text": "This is a wide teaser, usually used with the sidebar layout. It can contain multiple components and has an optional image.",
"title": "This is a wide teaser, usually used with the sidebar layout",
"published_date": "Gepost op Zaterdag 7 januari 2019",
"link_text": "Read more",
"link": "#",
"image_src": "https://via.placeholder.com/800x500&text=8:5+(800x500)",
"image_alt_text": "alt text",
"tag": "Optional tag",
"tag2": "More optional tags",
"event_date": {
"text_1": "From the 7th",
"datetime_1": "2019-01-07",
"text_2": "untill the 13th of January 2019",
"datetime_2": "2019-01-13"
},
"label_text": "Optional label",
"telephone": "0123456789",
"opening_hours_service": "2690",
"type": "teaser--wide",
"address_location": "Lakenhalle",
"address": "Botermarkt 18A, 9000 Gent",
"list": [
"List item 1",
"List item 2 is a bit longer",
"List item 3",
"List item 4"
]
}
//
// Basic teaser theming.
//
.teaser {
position: relative;
list-style: none;
&.teaser-programme, /// @deprecated
&.teaser--inverted {
.teaser-content {
@include theme('background-color', 'color-secondary');
}
.content__top, /// @deprecated
.content__first {
padding: 0 .8rem;
.figure-wrapper {
width: calc(100% + 1.6rem);
margin-left: -.8rem;
}
}
.content__bottom, /// @deprecated
.content__second {
padding: 0 .8rem .8rem;
}
}
&.teaser-topic, /// @deprecated
&.teaser--underlined {
.teaser-content {
@include theme('border-color', 'color-primary--lighten-4', 'teaser-contact-border');
height: 100%;
padding-bottom: .7rem;
border-bottom: 2px solid;
}
// @TODO: Move to other layer.
.ol-popup & {
padding-bottom: 0;
border-bottom: 0;
}
.content__bottom, /// @deprecated
.content__second {
display: flex;
flex-direction: column;
align-items: stretch;
> *:last-child {
margin-bottom: 0;
}
}
.teaser-title-link {
margin-bottom: .8rem;
font-size: .8rem;
line-height: 1.2rem;
}
.read-more {
margin-top: auto;
}
// @TODO: Move to other layer.
.grid-3 & {
.content__bottom, /// @deprecated
.content__second {
flex-grow: 1;
}
}
}
figure {
figcaption {
display: none;
}
}
a.teaser-overlay-link {
@include reset-link-background;
@include element-states(transparent, transparent, background-color);
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
text-indent: 200%;
white-space: nowrap;
overflow: hidden;
z-index: z('teaser', 'overlay-link');
}
a.read-more {
@include bold-text
}
.teaser-content {
display: flex;
flex-direction: column;
.teaser-topic-links, /// @deprecated
.teaser-contact-info, /// @deprecated
.teaser-links {
@extend %list-no-style;
margin-top: -$link-padding;
margin-bottom: .4rem;
a {
font-weight: normal;
}
}
.content__top, /// @deprecated
.content__first {
position: relative;
order: 1;
overflow: hidden;
}
.content__bottom, /// @deprecated
.content__second {
order: 2;
}
.figure-wrapper {
position: relative;
}
h3 {
margin-bottom: .4rem;
}
a {
position: relative;
z-index: z('teaser', 'content-link');
}
span.teaser-label {
@include theme('background-color', 'color-primary--lighten-5', 'teaser-label-background-color');
display: flex;
position: absolute;
top: .8rem;
left: .8rem;
align-items: center;
padding: 0 .5em;
border-radius: border-radius('radius-1');
line-height: 2;
z-index: z('teaser', 'label');
i {
margin-right: .4rem;
font-size: 1.2rem;
}
}
p {
margin-bottom: .4rem;
line-height: 1.7;
}
div.event,
time.published {
display: inline-block;
margin: 0 0 .4rem;
line-height: 1.5;
}
div.event {
@include icon('calendar');
display: flex;
align-items: flex-start;
&::before {
padding-right: .4rem;
font-size: 1.2rem;
line-height: 1;
}
}
time.published {
color: color('dark-gray', -1);
font-style: italic;
line-height: 2;
}
}
.content__top, /// @deprecated
.content__first {
> * {
margin-bottom: .8rem;
}
}
}
//
// Teaser wide variant.
//
.teaser.teaser-search, /// @deprecated
.teaser.teaser-search-wide, /// @deprecated
.teaser.teaser--wide {
@include tablet {
dt,
dd {
display: inline;
}
}
@include theme('border-color', 'color-primary--lighten-4', 'view-heading-2-border-color');
padding-top: $gutter-width;
padding-bottom: $gutter-width;
border-bottom: 2px solid;
&:first-of-type {
@include theme('border-color', 'color-primary--lighten-4', 'view-heading-2-border-color');
margin-top: $gutter-width;
border-top: 2px solid;
}
dl dd {
margin: 0;
padding-left: .5rem;
}
.tag,
.icon-list {
margin-bottom: .4rem;
}
.teaser-content {
display: flex;
flex-direction: row;
flex-wrap: wrap;
@include tablet {
flex-wrap: nowrap;
}
}
.accolade-inverse.bottom-left {
display: block;
@include phablet {
display: none;
}
}
.accolade-inverse.right-top {
display: none;
@include phablet {
display: block;
}
}
.content__left, /// @deprecated
.content__first,
.content__right, /// @deprecated
.content__second {
flex-basis: 100%;
}
.content__left, /// @deprecated
.content__first {
order: 1;
margin-bottom: gutter();
@include phablet {
flex-basis: span(5 of 18);
margin-right: gutter();
margin-bottom: 0;
}
}
.content__right, /// @deprecated
.content__second {
order: 2;
@include phablet {
flex-basis: span(13 of 18);
}
.location {
@include bold-text;
i {
margin-right: .3rem;
font-size: 1.5em;
vertical-align: middle;
}
}
.links {
margin-bottom: .4rem;
li {
margin-right: 0;
&::after {
margin-right: .4rem;
margin-left: .4rem;
content: '—';
}
&:last-of-type::after {
content: '';
}
}
}
}
}