|
| 1 | +{# |
| 2 | + # Available Props: |
| 3 | + # - call_to_action__theme: white-bg (default), light-blue-bg |
| 4 | + # |
| 5 | + # Available variables: |
| 6 | + # - call_to_action__heading |
| 7 | + # - call_to_action__overline(optional) |
| 8 | + # - call_to_action__text |
| 9 | + # - call_to_action__button__text |
| 10 | + # - call_to_action__button__url |
| 11 | + #} |
| 12 | + |
| 13 | +{% set call_to_action__base_class = 'call-to-action' %} |
| 14 | + |
| 15 | +{% set call_to_action__attributes = { |
| 16 | + 'data-component-theme': call_to_action__theme|default('white-bg'), |
| 17 | + 'class': bem(call_to_action__base_class, call_to_action__modifiers, call_to_action__blockname) |
| 18 | +} %} |
| 19 | + |
| 20 | +<div {{ add_attributes(call_to_action__attributes) }}> |
| 21 | + {# Content #} |
| 22 | + <div {{ bem('content', [], call_to_action__base_class) }}> |
| 23 | + {# Text overline #} |
| 24 | + {% if call_to_action__overline %} |
| 25 | + {% include "@components/typography/text/text.twig" with { |
| 26 | + text__content: call_to_action__overline, |
| 27 | + text__blockname: call_to_action__base_class, |
| 28 | + text__base_class: 'overline', |
| 29 | + } %} |
| 30 | + {% endif %} |
| 31 | + {# Heading #} |
| 32 | + {% if call_to_action__heading %} |
| 33 | + {% include "@components/typography/heading/heading.twig" with { |
| 34 | + heading: call_to_action__heading, |
| 35 | + heading__level: '2', |
| 36 | + heading__blockname: call_to_action__base_class, |
| 37 | + } %} |
| 38 | + {% endif %} |
| 39 | + {# Text #} |
| 40 | + {% if call_to_action__text %} |
| 41 | + {% include "@components/typography/text/text.twig" with { |
| 42 | + text__content: call_to_action__text, |
| 43 | + text__blockname: call_to_action__base_class, |
| 44 | + } %} |
| 45 | + {% endif %} |
| 46 | + {# optional link #} |
| 47 | + {# Render the action button #} |
| 48 | + {% if call_to_action__button__text and call_to_action__button__url %} |
| 49 | + <div {{ bem('action', [call_to_action__variant], call_to_action__base_class) }}> |
| 50 | + {% include "@components/button/button.twig" with { |
| 51 | + button__content: call_to_action__button__text, |
| 52 | + button__style: 'primary', |
| 53 | + button__attributes: { |
| 54 | + 'href': call_to_action__button__url, |
| 55 | + } |
| 56 | + } %} |
| 57 | + </div> |
| 58 | + {% endif %} |
| 59 | + </div> |
| 60 | +</div> |
| 61 | + |
0 commit comments