Allow to override filter labels via third party settings

Created on 29 September 2025, 12 days ago

Problem/Motivation

Consider the following scenario. I have a filter is_private labeled Is private with possible values Yes (value: 1) and No (value: 0). I don’t want the filter summary to display Is private: Yes or Is private: No. Instead, I want to show Is private and Is public. I’d prefer not to hardcode these strings in code; I’d like to define them in configuration.

Proposed resolution

I propose adding a feature that allows defining these third-party settings in the view’s YAML file:

third_party_settings:
  views_filters_summary:
    label_overrides:
      -
        filter: is_private
        custom_labels:
          -
            value: 0
            label: 'Is public'
          -
            value: 1
            label: 'Is private'

The existing solution that allows label overrides via hook_views_filters_summary_info_alter() should remain available for more advanced cases.

📌 Task
Status

Active

Version

3.2

Component

Code

Created by

🇵🇱Poland gugalamaciek

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024