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

ISTWCMS-5195: adding many card elements to make card easier to read

parent b3dbc185
No related branches found
No related tags found
1 merge request!118Feature/istwcms 5195 ebremner node theming
Showing
with 108 additions and 87 deletions
...@@ -4,23 +4,16 @@ ...@@ -4,23 +4,16 @@
{% set node_image_class = 'without-image' %} {% set node_image_class = 'without-image' %}
{% endif %} {% endif %}
{{ dd(node) }}
<div class="uw-node__{{ node_image_class }}"> <div class="uw-node__{{ node_image_class }}">
{% include '@components/card/card.twig' with { {% include '@components/card/card.twig' with {
'type': type, 'type': type,
'title': node.title, 'hero_image': node.hero_image,
'sub_title': node.sub_title, 'header': node.header,
'featured_image': featured_image,
'hero': node.hero,
'date': node.date,
'tags': node.tags, 'tags': node.tags,
'content': node.content, 'content': node.content,
'sources': node.image.sources, 'sources': node.image.sources,
'img_element': node.image.img_element,
'image': node.image.uri,
'alt': node.image.alt,
'header_level': 2,
'show_hover': '', 'show_hover': '',
'author': node.author,
'url': node.url, 'url': node.url,
'additional_info': node.additional_info, 'additional_info': node.additional_info,
'location_info': node.location_info, 'location_info': node.location_info,
......
<div class="card__author">
by
{% if author.link %}
<a href="{{ author.link }}">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}
</div>
<div class="card__content">
{{ content }}
</div>
<div class="card__date">
{% include '@components/date/date.twig' with {
'date_format': date_format,
'date': date,
} %}
</div>
<div class="card__header">
{% if header.date %}
{% include '@components/card/card-elements/_date.twig' with {
'date_format': date_format,
'date': header.date,
} %}
{% endif %}
{% if show_title == 'yes' %}
{% include '@components/card/card-elements/_title.twig' with {
'header_level': 2,
'title': header.title,
} %}
{% endif %}
{% if header.position %}
{% include '@components/card/card-elements/_position.twig' with {
'position': position
} %}
{% endif %}
{% if header.author %}
{% include '@components/card/card-elements/_author.twig' with {
'author': header.author
} %}
{% endif %}
</div>
<div class="card__featured-image" style="background-image: url({{ hero.img_element }});" role="img" aria-label="{{ hero.alt }}">
</div>
<div class="card__media">
{% if url %}
<a href="{{ url }}">
{% endif %}
{% include "@components/responsive-image/responsive-image.twig" with {
sources: listing_image.sources,
img_element: listing_image.img_element,
alt: listing_image.alt
}%}
{% if url %}
</a>
{% endif %}
</div>
<div class="card__position">
{{ position }}
</div>
{% if header_level %}
<h{{ header_level }} class="card__title">
{% else %}
<div class="card__title">
<strong>
{% endif %}
{% if url %}
<a href="{{ url }}">
{% endif %}
{{ title }}
{% if url %}
</a>
{% endif %}
{% if header_level %}
</h{{ header_level }}>
{% else %}
</strong>
</div>
{% endif%}
{% if sub_title %}
<span class="sub-title">{{ sub_title }}</span>
{% endif %}
...@@ -9,84 +9,21 @@ ...@@ -9,84 +9,21 @@
<article class="card {{ modifier_classes }} {% if show_hover %} card--show-hover {% endif %} {{ card_type }}" > <article class="card {{ modifier_classes }} {% if show_hover %} card--show-hover {% endif %} {{ card_type }}" >
{% if featured_image == 'yes' and hero.img_element %} {% if hero_image %}
<div class="card__featured-image" style="background-image: url({{ hero.img_element }});" role="img" aria-label="{{ hero.alt }}"> {% include '@components/card/card-elements/_hero-image.twig' with {
</div> 'hero': hero_image,
} %}
{% endif %} {% endif %}
<div class="card__body"> <div class="card__body">
{% if title or author or date or sub_title or position %} {% include '@components/card/card-elements/_header.twig' with {
<div class="card__header"> 'header': header
{% if date %} } %}
<div class="card__date">
{% include '@components/date/date.twig' with {
'date_format': date_format,
'date': date,
} %}
</div>
{% endif %}
{% if show_title == 'yes' %}
{% if header_level %}
<h{{ header_level }} class="card__title">
{% else %}
<div class="card__title">
<strong>
{% endif %}
{% if url %}
<a href="{{ url }}">
{% endif %}
{{ title }}
{% if url %}
</a>
{% endif %}
</strong>
{% if header_level %}
</h{{ header_level }}>
{% else %}
</div>
{% endif%}
{% if sub_title %}
<span class="sub-title">{{ sub_title }}</span>
{% endif %}
{% endif %}
{% if position %}
<div class="card__position">
{{ position }}
</div>
{% endif %}
{% if author %}
<div class="card__author">
by
{% if author.link %}
<a href="{{ author.link }}">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
{% if not featured_image and (sources or img_element) %} {% if listing_image %}
<div class="card__media"> {% include '@components/card/card-elements/_listing-image.twig' with {
{% if url %} 'listing_image': listing_image
<a href="{{ url }}"> } %}
{% endif %}
{% include "@components/responsive-image/responsive-image.twig" with {
sources: sources,
img_element: img_element,
alt: alt
}%}
{% if url %}
</a>
{% endif %}
</div>
{% endif %} {% endif %}
{% if image and not card_type == 'banner' %} {% if image and not card_type == 'banner' %}
...@@ -96,9 +33,9 @@ ...@@ -96,9 +33,9 @@
{% endif %} {% endif %}
{% if content %} {% if content %}
<div class="card__content"> {% include '@components/card/card-elements/_content.twig' with {
{{ content }} 'content': content
</div> } %}
{% endif %} {% endif %}
</div> </div>
......
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