From ec911dfe7b06aa02dc4853a6ab75dd28daf46044 Mon Sep 17 00:00:00 2001 From: Pat Date: Mon, 27 Nov 2023 11:43:06 -0700 Subject: [PATCH] People List custom filter labels set globally rather than each page --- config/install/boulder_base.settings.yml | 5 +++++ .../content/node--ucb-people-list-page.html.twig | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/config/install/boulder_base.settings.yml b/config/install/boulder_base.settings.yml index 687ed82a..980adb63 100644 --- a/config/install/boulder_base.settings.yml +++ b/config/install/boulder_base.settings.yml @@ -24,3 +24,8 @@ ucb_social_share_position: '0' ucb_breadcrumb_nav: 1 ucb_date_format: '0' ucb_use_custom_logo: false +ucb_filter_1_label: 'Filter 1' +ucb_filter_2_label: 'Filter 2' +ucb_filter_3_label: 'Filter 3' + + diff --git a/templates/content/node--ucb-people-list-page.html.twig b/templates/content/node--ucb-people-list-page.html.twig index b8a0ab1c..c898ebb7 100644 --- a/templates/content/node--ucb-people-list-page.html.twig +++ b/templates/content/node--ucb-people-list-page.html.twig @@ -16,6 +16,11 @@ {% set isFrontPage = 'sr-only' %} {% endif %} +{# Global Labels for Filters 1-3, set in site config#} +{% set ucb_filter_1_label = drupal_config('boulder_base.settings', 'ucb_filter_1_label') %} +{% set ucb_filter_2_label = drupal_config('boulder_base.settings', 'ucb_filter_2_label') %} +{% set ucb_filter_3_label = drupal_config('boulder_base.settings', 'ucb_filter_3_label') %} + {% set classes = [ 'node', @@ -51,19 +56,19 @@ 'filter_1': { 'includes': content.field_ucb_people_filter_1|render|striptags|trim|split(' '), 'userAccessible': content.field_ucb_people_filter_1_s|render|striptags|trim == 'On', - 'label': content.field_ucb_people_filter_1_label|render|striptags|trim, + 'label': ucb_filter_1_label|render|striptags|trim, 'restrict': true }, 'filter_2': { 'includes': content.field_ucb_people_filter_2|render|striptags|trim|split(' '), 'userAccessible': content.field_ucb_people_filter_2_s|render|striptags|trim == 'On', - 'label': content.field_ucb_people_filter_2_label|render|striptags|trim, + 'label': ucb_filter_2_label|render|striptags|trim, 'restrict': true }, 'filter_3': { 'includes': content.field_ucb_people_filter_3|render|striptags|trim|split(' '), 'userAccessible': content.field_ucb_people_filter_3_s|render|striptags|trim == 'On', - 'label': content.field_ucb_people_filter_3_label|render|striptags|trim, + 'label': ucb_filter_3_label|render|striptags|trim, 'restrict': true } },