Use the call to action component on a page:
Do not use the call to action component for other uses than the uses listed above.
The call to action component consists of the following parts:
The primary action and the optional secondary action can both be one of the following types:
Links to web pages, e-mail addresses and telephone numbers are presented using a link. Links to documents are presented using a file download.
When using a call to action, please note the following:
A call to action has a certain behavior:
{% if content is not defined %}
{% set content %}
{% if description %}
{% include '@paragraph' with {
'text': description
} %}
{% endif %}
<{{ links|length > 1 ? 'ul' : 'div'}} class="links">
{% for link in links %}
{% set options = {
link: link.url,
text: link.text,
modifier: loop.first ? 'button button-large button-secondary' : 'standalone-link'
} %}
{% if link.size|length %}
{% set options = options|merge({
file: {
size: link.size,
type: 'pdf'
}
}) %}
{% endif %}
{% if links|length > 1 %}
<li>
{% endif %}
{% include '@file-download' with options %}
{% if links|length > 1 %}
</li>
{% endif %}
{% endfor %}
<{{ links|length > 1 ? '/ul' : '/div'}} class="links">
{% endset %}
{% endif %}
{% if color is not defined %}
{% set color = 'secondary' %}
{% endif %}
{% set background_class = '' %}
{% if color == 'primary' %}
{% set background_class = 'dark-background' %}
{% endif %}
{% if layout is not defined %}
{% set layout = 'image-none' %}
{% endif %}
<section class="cta-block {{ modifier }} {{ layout }}">
{% if layout != 'image-none' and src is defined %}
<div class="cta-block__image">
<img src="{{ src }}" alt="{{ alt_text }}" />
</div>
{% endif %}
<div class="cta-block__content">
{% include '@feature-block' with {
'modifier': color ~ ' ' ~ background_class,
'title': title,
'content': content
} %}
</div>
</section>
<section class="cta-block image-none">
<div class="cta-block__content">
<div class="feature-block secondary ">
<h2>This is a title</h2>
<p>
<p>Nulla nec eros lorem. Morbi at augue eu purus congue auctor. Sed id volutpat odio. Nunc congue diam vel diam venenatis.</p>
<ul class="links">
<li>
<a href='https://stad.gent/download' class="button button-large button-secondary" download title="This is a title">
An external download link </a>
<span class="file-type">
pdf
<span class="file-size">
(102kb)
</span>
</span>
</li>
<li>
<a href='#' class="standalone-link" title="This is a title">
An internal link </a>
</li>
</ul class="links">
</p>
</div>
</div>
</section>
{
"layout": "image-none",
"title": "This is a title",
"description": "Nulla nec eros lorem. Morbi at augue eu purus congue auctor. Sed id volutpat odio. Nunc congue diam vel diam venenatis.",
"color": "secondary",
"links": [
{
"text": "An external download link",
"url": "https://stad.gent/download",
"document": "document",
"size": "102kb"
},
{
"text": "An internal link",
"url": "#"
}
]
}
.cta-block {
display: flex;
position: relative;
flex-flow: column;
max-width: $bp-max-content;
margin: 60px 0;
@include phablet {
flex-flow: row;
}
&.image-none {
max-width: 48.5rem;
z-index: 1;
.cta-block__content {
@include theme-content('color-info-pastel', 'cta-shadow-color') {
@include abstract-shadow('bottom', 'left', $theme-color, null, 260px, 260px);
margin-left: 0; // Overwrite only the h-margin.
}
}
}
&.image-left,
&.image-right {
@include phablet {
margin-bottom: 130px;
}
}
.cta-block__image {
@include phablet {
flex-shrink: .3;
}
@include desktop {
min-width: 470px;
min-height: 470px;
}
}
.cta-block__content {
position: relative;
width: 100%;
z-index: 1;
@include phablet {
margin-top: auto;
}
li {
margin-top: 16px;
a {
font-size: .8rem;
}
&:first-of-type a {
@extend %button-secondary;
@include button;
@include button-large;
@include button-icon;
}
}
}
&.image-left {
.cta-block__image {
margin-right: 20px;
@include phablet {
margin-right: inherit;
}
}
.cta-block__content {
top: -20px;
left: 20px;
@include phablet {
top: auto;
bottom: -90px;
left: -60px;
.feature-block {
width: calc(100% + 60px);
}
}
}
}
&.image-right {
@include phablet {
flex-direction: row-reverse;
}
.cta-block__image {
margin-left: 20px;
@include phablet {
margin-left: inherit;
}
}
.cta-block__content {
top: -20px;
margin-right: 20px;
@include phablet {
top: auto;
bottom: -90px;
}
.feature-block {
margin-right: 20px;
@include phablet {
width: calc(100% + 60px);
margin-right: inherit;
}
}
}
}
&--multiple {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-right: -20px;
margin-left: -20px;
> .cta-block {
flex: 1 0 400px;
max-width: calc(100% - 40px);
margin-right: 20px;
margin-left: 20px;
}
}
}