Add a teaser template for case studies

This commit is contained in:
benjamin melançon 2018-12-18 11:12:54 -05:00
parent bc1f7e8d45
commit 3712f6eff5

View file

@ -0,0 +1,31 @@
{# Somewhat ironically, we take away the ability for case studies to be
represented by their title paragraph. Because we *don't* use the title
paragraph for the main listings on the front page and the /work page (both of
which use the tile view mode, which uses only set regular fields), the use of
the title paragraph for search results (and anywhere else we use teasers)
would be a surprise— the summary field, while also not used on the listing
pages, is at least consistently used across multiple content types.
See agaric/templates/layout/node--teaser.html.twig for variables.
#}
<a class="teaser media content" href="{{ url }}">
<div class="media-left">
{{ content.field_image }}
{% if node.bundle == 'case_study' and content.field_subtitle is not empty %}
<p class="byline is-mono">
{{ content.field_case_study_subtitle }}
</p>
{% endif %}
</div>
<div class="media-content content">
<h3 class="title is-5">{{ label }}</h3>
<div class="subtitle is-6">
{{ content.field_summary }}
</div>
</div>
</a>
<!-- Unexpected extra content -->
{{ content|without('field_body_paragraph', 'field_subtitle', 'field_image', 'field_summary', 'uid', 'created') }}