From 9a182cc2123926eaf24fa98f8a4435d9c668f12e Mon Sep 17 00:00:00 2001 From: Pat Date: Mon, 19 Aug 2024 13:10:15 -0600 Subject: [PATCH] Newsletter: allow for missing titles --- ...agraph--newsletter-section--email-html.html.twig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/paragraphs/paragraph--newsletter-section--email-html.html.twig b/templates/paragraphs/paragraph--newsletter-section--email-html.html.twig index b28966d4..1d4a488a 100644 --- a/templates/paragraphs/paragraph--newsletter-section--email-html.html.twig +++ b/templates/paragraphs/paragraph--newsletter-section--email-html.html.twig @@ -29,7 +29,10 @@ {% if (item.entity.field_newsletter_article_select.entity and item.entity.field_newsletter_article_select.entity.isPublished()) or (item.entity.field_newsletter_content_title and - item.entity.field_newsletter_content_title.value|render) %} + item.entity.field_newsletter_content_title.value|render) + or + item.entity.field_newsletter_content_text.value|render + %} {# Code to render selected article content (thumbnail) #} @@ -67,7 +70,7 @@ {# Code to render user made content (title) #} - {% elseif item.entity.field_newsletter_content_title.value|render %} + {% elseif item.entity.field_newsletter_content_title.value|render or item.entity.field_newsletter_content_text.value|render %} {% if item.entity.field_newsletter_content_url.0.url %} {% set actual_url = item.entity.field_newsletter_content_url.0.url.toString() %} {% set is_absolute = (actual_url starts with 'http://' or actual_url starts with 'https://') %} @@ -140,7 +143,9 @@ {% if (item.entity.field_newsletter_article_select.entity and item.entity.field_newsletter_article_select.entity.isPublished()) or (item.entity.field_newsletter_content_title and - item.entity.field_newsletter_content_title.value|render) %} + item.entity.field_newsletter_content_title.value|render) + or + item.entity.field_newsletter_content_text.value|render %}
@@ -186,7 +191,7 @@ {# Code to render user made content (title) #} - {% elseif item.entity.field_newsletter_content_title.value|render %} + {% elseif item.entity.field_newsletter_content_title.value|render or item.entity.field_newsletter_content_text.value|render %} {% if item.entity.field_newsletter_content_url.0.url %} {% set actual_url = item.entity.field_newsletter_content_url.0.url.toString() %} {% set is_absolute = (actual_url starts with 'http://' or actual_url starts with 'https://') %}