Skip to content
Snippets Groups Projects
Commit 17f8d22c authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4704: updating logic for card and nodes

parent e7f30b60
No related branches found
No related tags found
Loading
......@@ -3,7 +3,7 @@
sources: image.sources,
img_element: image.img_element,
alt: image.alt,
type: 'banner',
card_type: 'banner',
title: image.big_text,
sub_title: image.small_text,
header_level: 2,
......
{% if featured_image and node.image.img_element %}
{% if featured_image == 'yes' and node.image.img_element %}
{% set node_image_class = 'with-image' %}
{% else %}
{% set node_image_class = 'without-image' %}
......@@ -19,7 +19,6 @@
'show_hover': '',
'author': node.author,
'url': node.url,
'modifier_classes': 'node',
'email': node.email,
'phone': node.phone,
'location': node.location,
......@@ -29,5 +28,6 @@
'contact_for': node.contact_for,
'groups': node.groups,
'featured_image': featured_image,
'card_type': 'node',
} %}
</div>
......@@ -26,4 +26,5 @@
'additional_info': teaser.additional_info,
'contact_for': teaser.contact_for,
'groups': teaser.groups,
'card_type': 'teaser',
} %}
{% import '@base/macros/uw.macro.twig' as macros %}
<article class="card {{ modifier_classes }} {% if show_hover %} card--show-hover {% endif %} {{ type }}" >
{% set show_title = 'yes' %}
{% if title or sub_title %}
{% if card_type == 'node' and featured_image == 'no' %}
{% set show_title = 'no' %}
{% endif %}
{% endif %}
<article class="card {{ modifier_classes }} {% if show_hover %} card--show-hover {% endif %} {{ card_type }}" >
{% if featured_image == 'yes' and img_element %}
<div class="card__featured-image" style="background-image: url({{ img_element }});" role="img" aria-label="{{ alt }}">
......@@ -18,18 +25,18 @@
} %}
</div>
{% endif %}
{% if (title or sub_title) and featured_image == 'yes' %}
{% if title %}
<h{{ header_level }} class="card__title">
{% if url %}
{% if show_title == 'yes' %}
<h{{ header_level }} class="card__title">
{% if url %}
<a href="{{ url }}">
{% endif %}
{{ title }}
{% if url %}
{% endif %}
{{ title }}
{% if url %}
</a>
{% endif %}
</h{{ header_level }}>
{% endif %}
{% endif %}
</h{{ header_level }}>
{% if sub_title %}
<span class="sub-title">{{ sub_title }}</span>
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment