From 34ae15cefbeb9e70b6cf916b15e790abeafc74a4 Mon Sep 17 00:00:00 2001 From: Timur Tripp Date: Tue, 24 Sep 2024 10:55:38 -0600 Subject: [PATCH 1/2] CuBoulder/tiamat-theme#1304 Places first name and last name on the same line to prevent trimming of the space between them --- templates/content/node--ucb-person.html.twig | 2 +- .../field/field--field-ucb-person-first-name.html.twig | 6 ------ templates/field/field--field-ucb-person-last-name.html.twig | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 templates/field/field--field-ucb-person-first-name.html.twig delete mode 100644 templates/field/field--field-ucb-person-last-name.html.twig diff --git a/templates/content/node--ucb-person.html.twig b/templates/content/node--ucb-person.html.twig index ec439187..8783c60b 100644 --- a/templates/content/node--ucb-person.html.twig +++ b/templates/content/node--ucb-person.html.twig @@ -18,7 +18,7 @@

- {{ content.field_ucb_person_first_name }} {{ content.field_ucb_person_last_name }} + {{ content.field_ucb_person_first_name.0 }} {{ content.field_ucb_person_last_name.0 }}

{{ content.field_ucb_person_pronouns }} {% if content.field_ucb_person_title.0 or content.field_ucb_person_department.0 %} diff --git a/templates/field/field--field-ucb-person-first-name.html.twig b/templates/field/field--field-ucb-person-first-name.html.twig deleted file mode 100644 index 56ef5c31..00000000 --- a/templates/field/field--field-ucb-person-first-name.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{# -/** - * @file Contains the template to display the Person node's First name field. - */ -#} -{% if items.0 %}{{ items.0.content['#context'].value|trim }}{% endif %} diff --git a/templates/field/field--field-ucb-person-last-name.html.twig b/templates/field/field--field-ucb-person-last-name.html.twig deleted file mode 100644 index 589c646e..00000000 --- a/templates/field/field--field-ucb-person-last-name.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{# -/** - * @file Contains the template to display the Person node's Last name field. - */ -#} -{% if items.0 %}{{ items.0.content['#context'].value|trim }}{% endif %} From 83716c1e93eb6aa8eb122dac3e158edb27cd7dd0 Mon Sep 17 00:00:00 2001 From: Timur Tripp Date: Wed, 25 Sep 2024 09:41:09 -0600 Subject: [PATCH 2/2] CuBoulder/tiamat-theme#1304 Adds requested changes (trim and nbsp) --- templates/content/node--ucb-person.html.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/content/node--ucb-person.html.twig b/templates/content/node--ucb-person.html.twig index 8783c60b..6bfe81c5 100644 --- a/templates/content/node--ucb-person.html.twig +++ b/templates/content/node--ucb-person.html.twig @@ -14,11 +14,13 @@ ] %} {% set baseurlJSON = url('')|render|trim('/') %} +{% set firstName = content.field_ucb_person_first_name['#items'].0.value|trim %} +{% set lastName = content.field_ucb_person_last_name['#items'].0.value|trim %}

- {{ content.field_ucb_person_first_name.0 }} {{ content.field_ucb_person_last_name.0 }} + {{ firstName }} {{ lastName }}

{{ content.field_ucb_person_pronouns }} {% if content.field_ucb_person_title.0 or content.field_ucb_person_department.0 %} @@ -74,7 +76,7 @@