Overhaul card template for small cards

No paragraphs.  Keep it simple.

Ref #110
This commit is contained in:
benjamin melançon 2018-12-15 22:39:41 -05:00
parent a562086680
commit 8205777a9e

View file

@ -72,35 +72,13 @@
#}
<a class="card card-initiative is-blue" href="{{ url }}">
{% set has_title_paragraph = false %}
{% if content.field_body_paragraph %}
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
{% set has_title_paragraph = true %}
{{ paragraph }}
{% endif %}
{% endfor %}
{% endif %}
{% if not has_title_paragraph %}
<div class="media-left">
{{ content.field_image }}
{% if node.bundle == 'blog' and content.field_authors is not empty %}
<p class="byline is-mono">
By {{ content.field_authors }}<br />
On {{ date }}
</p>
{% endif %}
</div>
<div class="media-content content">
<h3 class="title is-5">{{ label }}</h3>
<div class="subtitle is-6">
<div class="card-image" style="background-image:url({{ content.field_image }})"></div>
<div class="card-content">
<h3 class="title">{{ label }}</h3>
<div class="subtitle">
{{ content.field_summary }}
</div>
</div>
{% endif %}
</a>
<!-- Unexpected extra content -->
{{ content|without('field_body_paragraph', 'field_authors', 'field_image', 'field_summary', 'uid', 'created') }}
{{ content|without('field_image', 'field_summary', 'uid', 'created') }}