From 8947003aaea62aad5bb21a4f5481b3453d49f079 Mon Sep 17 00:00:00 2001 From: ebremner <ebremner@uwaterloo.ca> Date: Fri, 14 May 2021 11:10:13 -0400 Subject: [PATCH] ISTWCMS-4695: updating card to handle sub title only and adding to banners yml to test --- .../04-components/banners/banners.yml | 2 +- source/_patterns/04-components/card/card.twig | 27 +++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/source/_patterns/04-components/banners/banners.yml b/source/_patterns/04-components/banners/banners.yml index 02bc7a06..ba26c36a 100644 --- a/source/_patterns/04-components/banners/banners.yml +++ b/source/_patterns/04-components/banners/banners.yml @@ -46,7 +46,7 @@ banners: type: 'image/jpeg' img_element: '../../../../source/images/president/president_xlarge.jpg' alt: 'Alternative text' - big_text: 'Image2' + small_text: 'Image2' - sources: - srcset: '../../../../source/images/president/president_xlarge.jpg' diff --git a/source/_patterns/04-components/card/card.twig b/source/_patterns/04-components/card/card.twig index 8498f2fd..66d07abe 100644 --- a/source/_patterns/04-components/card/card.twig +++ b/source/_patterns/04-components/card/card.twig @@ -3,7 +3,7 @@ <article class="card {{ modifier_classes }} {% if show_hover %} card--show-hover {% endif %} {{ type }}" > <div class="card__body"> - {% if title or author or date %} + {% if title or author or date or sub_title %} <div class="card__header"> {% if date %} <div class="card__date"> @@ -23,19 +23,24 @@ </div> {% endif %} - {% if title %} - <h{{ header_level }} class="card__title"> - {% if url %} - <a href="{{ url }}"> - {% endif %} - {{ title }} - {% if url %} - </a> - {% endif %} - </h{{ header_level }}> + {% if title or sub_title %} + + {% if title %} + <h{{ header_level }} class="card__title"> + {% if url %} + <a href="{{ url }}"> + {% endif %} + {{ title }} + {% if url %} + </a> + {% endif %} + </h{{ header_level }}> + {% endif %} + {% if sub_title %} <span class="sub-title">{{ sub_title }}</span> {% endif %} + {% endif %} {% if author_name %} -- GitLab