Newer
Older
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
40
41
42
43
44
45
46
47
{#
/**
*
* Pattern for the card molecule
*
* Available variables:
* - infobox_modifiers - array of modifiers to add to the base classname
* - infobox_size: card size, either small, medium or large
* - infobox_extra_classes: string of extra classes to add to main div
* - infobox_heading_level: defaults to 2
* - infobox_title: title
* - infobox_link: link from title (leave blank for no link)
* - infobox_text: the content of the paragraph(s)
#}
{% set infobox_base_class = infobox_base_class|default('info-box') %}
{% set classes_array = [infobox_base_class] %}
{% if (infobox_modifiers is defined) or (infobox_size is defined) %}
{% if infobox_modifiers is defined %}
{% for infobox_modifier in infobox_modifiers %}
{% set classes_array = classes_array|merge(["#{infobox_base_class}--#{infobox_modifier}"]) %}
{% endfor %}
{% endif %}
{% set infobox_classes = classes_array|join(' ') %}
{% if infobox_size is defined %}
{% set classes_array = classes_array|merge(["#{infobox_base_class}--#{infobox_size}"]) %}
{% endif %}
{% set infobox_classes = classes_array|join(' ') %}
{% else %}
{% set infobox_classes = infobox_base_class %}
{% endif %}
<div class="{{ infobox_classes }} {{ infobox_extra_classes }}">
<div class="info-box__title">
{% include "@atoms/00-text/00-headings/_heading.twig" with {
"heading_level": infobox_heading_level|default(2),
"heading": infobox_title,
} %}
</div>
<div class="info-box__body">
{% include "@atoms/00-text/04-paragraph/paragraph.twig" with {
"paragraph_content": infobox_text,
} %}
</div>
</div>