Skip to content

Commit

Permalink
Merge pull request #560 from CuBoulder/issue/tiamat-theme/543
Browse files Browse the repository at this point in the history
People List Filter Labels as a Global Setting
  • Loading branch information
jcsparks authored Nov 30, 2023
2 parents 675de04 + 05add88 commit 6df34d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config/install/boulder_base.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'


11 changes: 8 additions & 3 deletions templates/content/node--ucb-people-list-page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
}
},
Expand Down

0 comments on commit 6df34d4

Please sign in to comment.