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>
<div class="links">
<a href='#' class="button button-large button-secondary" title="This is a title">
An internal link </a>
</div class="links">
</p>
</div>
</div>
</section>
{
"layout": "image-none",
"title": "This is a title",
"description": false,
"color": "secondary",
"links": [
{
"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);
}
}
.feature-block {
margin-right: 20px;
}
}
}
&.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;
}
}
}