Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 7ff0c7a2 authored by escuriola's avatar escuriola
Browse files

OEL-1159: Adapt news to card last changes.

parent ead5c13b
No related branches found
No related tags found
4 merge requests!121OEL-1421: Fix cosmetic changes.,!116OEL-1394: Merge 1.x into EPIC-1293-Project, align with new version of card:search pattern,!115Upate the EPIC-1293-project,!112OEL-1159: Adapt starter content entities to card last changes.
......@@ -66,11 +66,11 @@ function oe_whitelabel_starter_news_preprocess_node__oe_sc_news(&$variables) {
}
$thumbnail = $media->get('thumbnail')->first();
$variables['image'] = ImageValueObject::fromImageItem($thumbnail);
if ($variables['view_mode'] == 'teaser') {
$variables['image'] = ['#markup' => $variables['image']->getSource()];
if ($thumbnail === NULL) {
$cacheability->applyTo($variables);
return;
}
$variables['image'] = ImageValueObject::fromImageItem($thumbnail);
$cacheability->applyTo($variables);
}
......@@ -7,17 +7,18 @@
{% set _title %}
<a class="standalone" href="{{ url }}">{{ label }}</a>
{% endset %}
{% set _content %}
<span class="text-muted text-nowrap me-4-5">{{ content.oe_publication_date }}</span>
{% endset %}
{% block content %}
<article{{attributes}}>
{{ pattern('card', {
variant: 'search',
title: _title,
text: content.oe_summary,
image: image,
content: _content
image: image|merge({
path: image.src,
}),
meta: [
content.oe_publication_date
],
}) }}
</article>
{% endblock %}
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