From 0aa290acb4cd442ca8136aa6d585e72bce04dc0c Mon Sep 17 00:00:00 2001 From: 22Alexandra Date: Thu, 19 Sep 2024 09:49:28 +0300 Subject: [PATCH] EWPP-4750: Fix the extra_attributes variable in node templates. --- templates/content/node--oe-call-proposals--teaser.html.twig | 4 +--- templates/content/node--oe-call-tenders--teaser.html.twig | 4 +--- templates/content/node--oe-consultation--teaser.html.twig | 4 +--- templates/content/node--oe-event--teaser.html.twig | 3 +-- templates/content/node--oe-news--teaser.html.twig | 3 +-- templates/content/node--oe-organisation--teaser.html.twig | 4 +--- templates/content/node--oe-page--teaser.html.twig | 3 +-- templates/content/node--oe-person--teaser.html.twig | 4 +--- templates/content/node--oe-policy--teaser.html.twig | 3 +-- templates/content/node--oe-project--teaser.html.twig | 4 +--- templates/content/node--oe-publication--teaser.html.twig | 3 +-- 11 files changed, 11 insertions(+), 28 deletions(-) diff --git a/templates/content/node--oe-call-proposals--teaser.html.twig b/templates/content/node--oe-call-proposals--teaser.html.twig index 44cad6329..4f4034691 100644 --- a/templates/content/node--oe-call-proposals--teaser.html.twig +++ b/templates/content/node--oe-call-proposals--teaser.html.twig @@ -16,8 +16,6 @@ {% set additional_information = additional_information|merge([additional_information_items]) %} {% endif %} -{% set extra_attributes = [] %} - {# Add cache info from status field. #} {% set bubble_cache = content.extra_field_oe_call_proposals_label_status|render %} {% block content %} @@ -29,6 +27,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-call-tenders--teaser.html.twig b/templates/content/node--oe-call-tenders--teaser.html.twig index 01d9c8e8d..8831e584a 100644 --- a/templates/content/node--oe-call-tenders--teaser.html.twig +++ b/templates/content/node--oe-call-tenders--teaser.html.twig @@ -16,8 +16,6 @@ {% set additional_information = additional_information|merge([additional_information_items]) %} {% endif %} -{% set extra_attributes = [] %} - {# Add cache info from status field. #} {% set bubble_cache = content.extra_field_oe_call_tenders_label_status|render %} {% block content %} @@ -29,6 +27,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-consultation--teaser.html.twig b/templates/content/node--oe-consultation--teaser.html.twig index 8c042f646..3106ce2b7 100644 --- a/templates/content/node--oe-consultation--teaser.html.twig +++ b/templates/content/node--oe-consultation--teaser.html.twig @@ -16,8 +16,6 @@ {% set additional_information = additional_information|merge([additional_information_items]) %} {% endif %} -{% set extra_attributes = [] %} - {# Add cache info from status field. #} {% set bubble_cache = content.extra_field_oe_consultation_label_status|render %} {% block content %} @@ -29,6 +27,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-event--teaser.html.twig b/templates/content/node--oe-event--teaser.html.twig index f8834e6c7..4e7f3801c 100644 --- a/templates/content/node--oe-event--teaser.html.twig +++ b/templates/content/node--oe-event--teaser.html.twig @@ -11,7 +11,6 @@ {% endif %} {% set detail = content.extra_field_oe_theme_content_event_teaser_details %} {% set additional_information = [] %} -{% set extra_attributes = [] %} {% block content %} {{ pattern('list_item', { 'variant': variant|default('date'), @@ -24,6 +23,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-news--teaser.html.twig b/templates/content/node--oe-news--teaser.html.twig index 44212c740..1f618075e 100644 --- a/templates/content/node--oe-news--teaser.html.twig +++ b/templates/content/node--oe-news--teaser.html.twig @@ -14,7 +14,6 @@ ] %} {% set detail = content.oe_teaser|field_value %} {% set additional_information = [] %} -{% set extra_attributes = [] %} {% apply spaceless %} {% block content %} {{ pattern('list_item', { @@ -28,7 +27,7 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} {% endapply %} diff --git a/templates/content/node--oe-organisation--teaser.html.twig b/templates/content/node--oe-organisation--teaser.html.twig index 7dd576f9e..bfcad472d 100644 --- a/templates/content/node--oe-organisation--teaser.html.twig +++ b/templates/content/node--oe-organisation--teaser.html.twig @@ -20,8 +20,6 @@ {% endfor %} {% endif %} -{% set extra_attributes = [] %} - {% block content %} {{ pattern('list_item', { 'variant': 'thumbnail_secondary', @@ -37,6 +35,6 @@ 'image': image_url ? { 'src': image_url }, 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-page--teaser.html.twig b/templates/content/node--oe-page--teaser.html.twig index 721c5e900..de85a1363 100644 --- a/templates/content/node--oe-page--teaser.html.twig +++ b/templates/content/node--oe-page--teaser.html.twig @@ -4,7 +4,6 @@ * Teaser template implementation for "Page" content type. */ #} -{% set extra_attributes = [] %} {% block content %} {{ pattern('list_item', { 'variant': 'default', @@ -15,6 +14,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-person--teaser.html.twig b/templates/content/node--oe-person--teaser.html.twig index de9ffdc8e..f5bf56a66 100644 --- a/templates/content/node--oe-person--teaser.html.twig +++ b/templates/content/node--oe-person--teaser.html.twig @@ -45,8 +45,6 @@ {% set additional_information = additional_information|merge([additional_information_items]) %} {% endif %} -{% set extra_attributes = [] %} - {% block content %} {{ pattern('list_item', { 'variant': 'thumbnail_secondary', @@ -59,6 +57,6 @@ 'image': content.portrait_image ? { 'src': content.portrait_image|render }, 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-policy--teaser.html.twig b/templates/content/node--oe-policy--teaser.html.twig index 852ba331d..81c43af97 100644 --- a/templates/content/node--oe-policy--teaser.html.twig +++ b/templates/content/node--oe-policy--teaser.html.twig @@ -4,7 +4,6 @@ * Teaser template implementation for "Policy" content type. */ #} -{% set extra_attributes = [] %} {% block content %} {{ pattern('list_item', { 'variant': 'default', @@ -15,6 +14,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-project--teaser.html.twig b/templates/content/node--oe-project--teaser.html.twig index 7725ccd88..ef58f1ad1 100644 --- a/templates/content/node--oe-project--teaser.html.twig +++ b/templates/content/node--oe-project--teaser.html.twig @@ -17,8 +17,6 @@ {% set additional_information = additional_information|merge([additional_information_items]) %} {% endif %} -{% set extra_attributes = [] %} - {% block content %} {{ pattern('list_item', { 'variant': 'thumbnail_secondary', @@ -30,6 +28,6 @@ 'image': image_url ? { 'src': image_url }, 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %} diff --git a/templates/content/node--oe-publication--teaser.html.twig b/templates/content/node--oe-publication--teaser.html.twig index 7e4fe9f71..0ac468b5f 100644 --- a/templates/content/node--oe-publication--teaser.html.twig +++ b/templates/content/node--oe-publication--teaser.html.twig @@ -5,7 +5,6 @@ */ #} {% set image_url = content.oe_publication_thumbnail|field_value|render %} -{% set extra_attributes = [] %} {% block content %} {{ pattern('list_item', { 'variant': 'thumbnail_secondary', @@ -22,6 +21,6 @@ 'lists_variant': 'vertical', 'badges': badges, 'external_link': external_link, - 'extra_attributes': extra_attributes, + 'extra_attributes': extra_attributes|default([]), }) }} {% endblock %}