diff --git a/source/_patterns/04-components/card/card--node/card--node.twig b/source/_patterns/04-components/card/card--node/card--node.twig index a882838df82597986c96c836914fd941b67fb6a3..5e875441e42c80d8fe7ae5c4d7ba61d9c42ca314 100644 --- a/source/_patterns/04-components/card/card--node/card--node.twig +++ b/source/_patterns/04-components/card/card--node/card--node.twig @@ -1,31 +1,33 @@ {% if featured_image and node.image.img_element %} - <div class="uw-node__with-image"> + {% set node_image_class = 'with-image' %} +{% else %} + {% set node_image_class = 'without-image' %} {% endif %} -{% include '@components/card/card.twig' with { - 'title': node.title, - 'sub_title': node.sub_title, - 'date': node.date, - 'tags': node.tags, - 'content': node.content, - 'sources': node.image.sources, - 'img_element': node.image.img_element, - 'image': node.image.uri, - 'alt': node.image.alt, - 'header_level': 2, - 'show_hover': '', - 'author': node.author, - 'url': node.url, - 'modifier_classes': 'node', - 'email': node.email, - 'phone': node.phone, - 'location': node.location, - 'link_profile': node.link_profile, - 'personal_webpage': node.personal_webpage, - 'additional_info': node.additional_info, - 'contact_for': node.contact_for, - 'groups': node.groups, - 'featured_image': featured_image, -} %} -{% if featured_image and img_element %} - </div> -{% endif %} \ No newline at end of file + +<div class="uw-node__{{ node_image_class }}"> + {% include '@components/card/card.twig' with { + 'title': node.title, + 'sub_title': node.sub_title, + 'date': node.date, + 'tags': node.tags, + 'content': node.content, + 'sources': node.image.sources, + 'img_element': node.image.img_element, + 'image': node.image.uri, + 'alt': node.image.alt, + 'header_level': 2, + 'show_hover': '', + 'author': node.author, + 'url': node.url, + 'modifier_classes': 'node', + 'email': node.email, + 'phone': node.phone, + 'location': node.location, + 'link_profile': node.link_profile, + 'personal_webpage': node.personal_webpage, + 'additional_info': node.additional_info, + 'contact_for': node.contact_for, + 'groups': node.groups, + 'featured_image': featured_image, + } %} +</div>