This module "populates" other filters on the view with the provided value, allowing to use one exposed filter to search several others.
It's similar to the Global: Combine fields filter available on Drupal 8 and on Views 7.x-3.4+ but with the following differences:
- Global: Combine fields can only be used on displays with fields, this one doesn't have that limitation.
- Global: Combine fields concatenates the fields on the query and then filters by it, this could break aggregation and adds duplication issues. It also may have a performance hit. This module "populates" other filters, so it just works as if the filter value was provided.
- Because you don't need the field to be added, it helps filtering on aggregated (GROUP BY) views.
- Each field can have its own operator.
- OR/AND can be combined as needed
It only populates non exposed filters that expects a string text field, so those filters that take an array (options) or special types won't work.
How to use this module
Let's assume that you have "First Name", "Second Name" and "Last name" on some entity and you'd like to use one expose filter to search on any of those fields.
1. Download and enable this module.
2. Create an OR group of filters for each of the fields that you want to search on; make sure you don't expose those filters and that you choose the appropriate operator that will accompany the value for each filter.
3. Add another filter found on the 'Global' section called 'Populate filters'.
4. Expose it and check the filters which you have previously added that you wish this exposed filter to populate, on our example they are first name, second name and last name. Remember that only supported and non exposed filters will be available for selection.
That should be it.
As a reference, this module was born out of ideas, suggestions and needs discussed in #451000: Apply One Exposed Filter to Multiple Fields.
Project information
- 5,628 sites report using this module
- Created by hanoii on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Adds support for D10.
Development version: 2.x-dev updated 20 Aug 2023 at 16:46 UTC
Development version: 7.x-1.x-dev updated 20 Feb 2019 at 03:43 UTC