Skip to content
Snippets Groups Projects
Commit 006e94fd authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-5880: using media flags instead of logic inside the templates

parent c617fd10
No related branches found
No related tags found
1 merge request!48ISTWCMS-5880: ensuring that title displays when banner is used
......@@ -4,5 +4,6 @@
'show_header': 'no',
'type': 'banner',
'faculty': faculty,
'bundle': banners.bundle,
} %}
{% endfor %}
......@@ -5,19 +5,19 @@
{% endif %}
{% set modifier_classes = 'node--' ~ node.bundle %}
<div class="uw-node__{{ node_image_class }}">
{% include '@components/card/card.twig' with {
'bundle': node.bundle,
'url': node.url,
'type': type,
'show_hover': '',
'header': node.header,
'show_header': show_header,
'media': node.media,
'image': node.image,
'content': node.content,
'footer': node.footer,
'tags': node.tags,
'ical': node.ical,
'media_flags': media_flags
} %}
</div>
......@@ -25,7 +25,7 @@
} %}
{% endif %}
{% if header.title and show_title == 'yes' %}
{% if header.title and (media_flags.has_media or type == 'teaser') %}
{% if type == 'teaser' %}
{% set header_level = '2' %}
......
......@@ -4,13 +4,6 @@
{% include '@components/banners/banners.twig' with {
'banners': media.media
} only %}
{% if header %}
{% include '@components/card/card-elements/_header.twig' with {
'header': header,
'show_title': 'yes',
'header_level': 1,
} %}
{% endif %}
{% endif %}
{% if media.type == 'image' %}
......
{% if show_header is null %}
{% set show_header = 'yes' %}
{% endif %}
{% if type == 'teaser' %}
{% set show_title = 'yes' %}
{% elseif media and (media.type == 'image' or media.type == 'banner') %}
{% set show_title = 'no' %}
{% set show_header = 'no' %}
{% else %}
{% set show_title = 'no' %}
{% endif %}
{% if show_image is null %}
{% set show_image = 'yes' %}
{% endif %}
<article class="card{% if type %} card__{{ type }} {% endif %}{% if modifier_classes %} card__{{ modifier_classes }}{% endif %}{% if show_hover %} card--show-hover{% endif %}" {% if type == 'banner' %} id="{{ type }}{{ loop.index }}-{{ banners.uuid }}"{% endif %}>
{% if media %}
{% if media_flags.has_media %}
{% include '@components/card/card-elements/_media.twig' with {
'media': media,
'header': header,
'bundle': bundle,
'media_flags': media_flags
} %}
{% endif %}
{% if image and show_image == 'yes' and bundle != 'uw_ct_profile' %}
{% if image and bundle != 'uw_ct_profile' %}
{% include '@components/card/card-elements/_image.twig' with {
'image': image
} %}
{% endif %}
{% if header and show_header == 'yes' %}
{% if header and not media_flags.show_header_in_media %}
{% include '@components/card/card-elements/_header.twig' with {
'header': header,
'show_title': show_title,
'type': type,
'image': image,
'bundle': bundle
'bundle': bundle,
'header_level': 1,
'media_flags': media_flags
} %}
{% 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