diff --git a/source/_patterns/04-components/card/card.twig b/source/_patterns/04-components/card/card.twig index 94f6e55167a2525ffa89245a0abed7400f616ccc..7bc9376bdd5d331414a379ea3e228c490995f64d 100644 --- a/source/_patterns/04-components/card/card.twig +++ b/source/_patterns/04-components/card/card.twig @@ -11,6 +11,12 @@ {% set show_header = 'yes' %} {% endif %} +{% if not hero_image and not listing_image and not banner and not content %} + {% set show_body = 'no' %} +{% else %} + {% set show_body = 'yes' %} +{% endif %} + <article class="card{% if type %} card__{{ type }}{% endif %}{% if show_hover %} card--show-hover {% endif %}" > {% if hero_image and show_header == 'yes' %} @@ -20,35 +26,37 @@ } %} {% endif %} - <div class="card__body"> + {% if show_body == 'yes' %} + <div class="card__body"> - {% if not hero_image and show_header == 'yes' %} - {% include '@components/card/card-elements/_header.twig' with { - 'header': header, - 'show_title': show_title, - 'type': type - } %} - {% endif %} + {% if not hero_image and show_header == 'yes' %} + {% include '@components/card/card-elements/_header.twig' with { + 'header': header, + 'show_title': show_title, + 'type': type + } %} + {% endif %} - {% if listing_image %} - {% include '@components/card/card-elements/_listing-image.twig' with { - 'listing_image': listing_image - } %} - {% endif %} + {% if listing_image %} + {% include '@components/card/card-elements/_listing-image.twig' with { + 'listing_image': listing_image + } %} + {% endif %} - {% if banner %} - {% include '@components/card/card-elements/_banner.twig' with { - 'banner': banner - } %} - {% endif %} + {% if banner %} + {% include '@components/card/card-elements/_banner.twig' with { + 'banner': banner + } %} + {% endif %} - {% if content %} - {% include '@components/card/card-elements/_content.twig' with { - 'content': content - } %} - {% endif %} + {% if content %} + {% include '@components/card/card-elements/_content.twig' with { + 'content': content + } %} + {% endif %} - </div> + </div> + {% endif %} {% if footer %} <div class="card__footer">