From 0a190a761bc2a0c6242f02bfd163e77ced39774f Mon Sep 17 00:00:00 2001 From: Pat Date: Fri, 16 Aug 2024 09:08:56 -0600 Subject: [PATCH 1/3] Article: byline linking to a Person page --- .../field/field--field_ucb_article_byline.html.twig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/field/field--field_ucb_article_byline.html.twig b/templates/field/field--field_ucb_article_byline.html.twig index 110fe2f5..6141696e 100644 --- a/templates/field/field--field_ucb_article_byline.html.twig +++ b/templates/field/field--field_ucb_article_byline.html.twig @@ -1,3 +1,14 @@ {% for item in items %} - {{item.content|render|striptags|trim}} + {% set byline_entity = item.content['#entity'] %} + {% if byline_entity.field_author_person_page|length > 0 %} + {% set author_person_page_entity = byline_entity.field_author_person_page.0.entity %} + {% if author_person_page_entity %} + {% set url = path('entity.node.canonical', {'node': author_person_page_entity.id()}) %} + {{ byline_entity.name.value }} + {% else %} + {{ byline_entity.name.value }} + {% endif %} + {% else %} + {{ byline_entity.name.value }} + {% endif %} {% endfor %} From 49b265ce52d46dca66f1e1f0995e33635fd5ec2d Mon Sep 17 00:00:00 2001 From: Pat Date: Fri, 16 Aug 2024 10:43:18 -0600 Subject: [PATCH 2/3] Articles: CSS for byline link on dark mode Articles --- css/ucb-article-dark.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/css/ucb-article-dark.css b/css/ucb-article-dark.css index d5807550..1159b884 100644 --- a/css/ucb-article-dark.css +++ b/css/ucb-article-dark.css @@ -34,6 +34,13 @@ article.ucb-page-style-dark { padding-bottom: 1.75em; } +article.ucb-page-style-dark .ucb-article-author-name a{ + color: var(--ucb-gold) +} +article.ucb-page-style-dark .ucb-article-author-name a:hover{ + color: var(--ucb-white) +} + /* Override for Dark-style Articles with a Title Image */ article.ucb-page-style-dark:has(.backgroundTitleDiv){ padding-top: 0; From c04b909a64693fdc97e71e4402eab042db67d017 Mon Sep 17 00:00:00 2001 From: Pat Date: Fri, 16 Aug 2024 10:48:23 -0600 Subject: [PATCH 3/3] Articles: absolute url --- templates/field/field--field_ucb_article_byline.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/field/field--field_ucb_article_byline.html.twig b/templates/field/field--field_ucb_article_byline.html.twig index 6141696e..1d7e2231 100644 --- a/templates/field/field--field_ucb_article_byline.html.twig +++ b/templates/field/field--field_ucb_article_byline.html.twig @@ -3,7 +3,7 @@ {% if byline_entity.field_author_person_page|length > 0 %} {% set author_person_page_entity = byline_entity.field_author_person_page.0.entity %} {% if author_person_page_entity %} - {% set url = path('entity.node.canonical', {'node': author_person_page_entity.id()}) %} + {% set url = url('entity.node.canonical', {'node': author_person_page_entity.id()}) %} {{ byline_entity.name.value }} {% else %} {{ byline_entity.name.value }}