From d5cbc453a7b0714675980fdd1202ce9f718cb837 Mon Sep 17 00:00:00 2001 From: Timur Tripp Date: Thu, 25 Jan 2024 10:24:08 -0700 Subject: [PATCH 1/2] CuBoulder/tiamat-theme#626 adds "Department" and Job Type" People List Page label fields --- config/install/ucb_site_configuration.settings.yml | 8 +++++--- src/Form/ContentTypesForm.php | 14 ++++++++++++++ src/SiteConfiguration.php | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/config/install/ucb_site_configuration.settings.yml b/config/install/ucb_site_configuration.settings.yml index 3617d94..4e305b4 100644 --- a/config/install/ucb_site_configuration.settings.yml +++ b/config/install/ucb_site_configuration.settings.yml @@ -16,6 +16,8 @@ article_date_format: '0' related_articles_enabled_by_default: FALSE related_articles_exclude_categories: [] related_articles_exclude_tags: [] -people_list_filter_1_label: '' -people_list_filter_2_label: '' -people_list_filter_3_label: '' +people_list_department_label: Department +people_list_job_type_label: Job Type +people_list_filter_1_label: Filter 1 +people_list_filter_2_label: Filter 2 +people_list_filter_3_label: Filter 3 diff --git a/src/Form/ContentTypesForm.php b/src/Form/ContentTypesForm.php index 3690213..3622d14 100644 --- a/src/Form/ContentTypesForm.php +++ b/src/Form/ContentTypesForm.php @@ -142,6 +142,18 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'details', '#title' => $this->t('People List Page'), '#open' => TRUE, + 'people_list_department_label' => [ + '#type' => 'textfield', + '#title' => $this->t('Department label'), + '#default_value' => $settings->get('people_list_department_label') ?? 'Department', + '#description' => $this->t('Choose the label that will be used for "Department" on People List Pages.'), + ], + 'people_list_job_type_label' => [ + '#type' => 'textfield', + '#title' => $this->t('Job Type label'), + '#default_value' => $settings->get('people_list_job_type_label') ?? 'Job Type', + '#description' => $this->t('Choose the label that will be used for "Job Type" on People List Pages.'), + ], 'people_list_filter_1_label' => [ '#type' => 'textfield', '#title' => $this->t('Filter 1 label'), @@ -173,6 +185,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ->set('related_articles_enabled_by_default', $form_state->getValue('related_articles_enabled_by_default')) ->set('related_articles_exclude_categories', array_keys(array_filter($form_state->getValue('related_articles_exclude_categories')))) ->set('related_articles_exclude_tags', array_keys(array_filter($form_state->getValue('related_articles_exclude_tags')))) + ->set('people_list_department_label', $form_state->getValue('people_list_department_label')) + ->set('people_list_job_type_label', $form_state->getValue('people_list_job_type_label')) ->set('people_list_filter_1_label', $form_state->getValue('people_list_filter_1_label')) ->set('people_list_filter_2_label', $form_state->getValue('people_list_filter_2_label')) ->set('people_list_filter_3_label', $form_state->getValue('people_list_filter_3_label')) diff --git a/src/SiteConfiguration.php b/src/SiteConfiguration.php index f49cc20..67d9491 100644 --- a/src/SiteConfiguration.php +++ b/src/SiteConfiguration.php @@ -409,6 +409,8 @@ public function attachArticlesConfiguration(array &$variables) { */ public function attachPeopleListConfiguration(array &$variables) { $settings = $this->getSettings(); + $variables['people_list_department_label'] = $settings->get('people_list_department_label') ?? 'Department'; + $variables['people_list_job_type_label'] = $settings->get('people_list_job_type_label') ?? 'Job Type'; $variables['people_list_filter_1_label'] = $settings->get('people_list_filter_1_label') ?? 'Filter 1'; $variables['people_list_filter_2_label'] = $settings->get('people_list_filter_1_label') ?? 'Filter 2'; $variables['people_list_filter_3_label'] = $settings->get('people_list_filter_1_label') ?? 'Filter 3'; From 9833cbdddd1991a29e8af386b9defa68a345d890 Mon Sep 17 00:00:00 2001 From: Timur Tripp Date: Thu, 25 Jan 2024 10:38:02 -0700 Subject: [PATCH 2/2] Increments version --- ucb_site_configuration.info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb_site_configuration.info.yml b/ucb_site_configuration.info.yml index 947b675..7d46d4b 100644 --- a/ucb_site_configuration.info.yml +++ b/ucb_site_configuration.info.yml @@ -2,7 +2,7 @@ name: CU Boulder Site Configuration description: 'Allows CU Boulder site administrators to configure site-specific settings.' core_version_requirement: ^9 || ^10 type: module -version: '2.6.2' +version: '2.6.3' package: CU Boulder dependencies: - block