Created
September 8, 2018 13:00
-
-
Save markconroy/569c91f9893f411bec282a4633891fa6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% | |
set classes = [ | |
"card", | |
card_image ? 'card--has-image', | |
card_style ? 'card--' ~ card_style, | |
card_size ? 'card--' ~ card_size, | |
] | |
%} | |
{% if card_link_url %} | |
{% set element = 'a' %} | |
{% else %} | |
{% set element = 'div' %} | |
{% endif %} | |
<{{element}}{{ attributes.addClass(classes) }}{% if card_link_url %} href="{{ card_link_url}}"{% endif %}> | |
{% if card_image %} | |
<div class="card__image"> | |
{{ card_image }} | |
</div> | |
{% endif %} | |
<div class="card__content"> | |
{% if card_title %} | |
<div class="card__title h1"> | |
{{ card_title }} | |
</div> | |
{% endif %} | |
{% if card_text %} | |
<div class="card__text"> | |
{{ card_text }} | |
</div> | |
{% endif %} | |
</div> | |
</{{element}}> | |
{% block content_variable %} | |
{# | |
This allows the cache_context to bubble up for us, without having to | |
individually list every field in | |
{{ content|without('field_name', 'field_other_field', 'field_etc') }} | |
#} | |
{% set catch_cache = content|render %} | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment