Configurable Views Filter Block

Extends the default Views exposed filters block with per-instance configuration options, allowing you to display only specific filters in each block instance.

configurable_views_filter_block
1,306 sites
24
drupal.org
gui
Drupal 9 Drupal 10 Drupal 11

Install

Drupal 11, 10, 9 v1.0.0
composer require 'drupal/configurable_views_filter_block:^1.0'

Overview

Configurable Views Filter Block extends Drupal core's Views exposed filter block functionality by allowing site builders to create multiple instances of the exposed filters form, each showing only a custom subset of the available filters.

The module provides granular visibility control over individual exposed filters, the reset button, sort options, and pager controls. Additionally, when Views exposed filters are grouped into collapsible fieldsets (details elements), this module can convert them to plain containers for a cleaner presentation in specific instances.

This is particularly useful for complex layouts where you want to distribute filters across multiple regions of your page, or when combining Views exposed filters with faceted search blocks.

Features

  • Create multiple instances of the same Views exposed filter block with different filter visibility settings
  • Select which specific exposed filters to display in each block instance
  • Hide or show the Reset button per block instance
  • Hide or show exposed sort criteria per block instance
  • Hide or show exposed pager options (items per page, offset) per block instance
  • Remove collapsible fieldset groups and display filters as plain form elements
  • Preserves filter form values even when visually hidden to maintain filter state across blocks
  • Generates unique form IDs for each block instance to prevent conflicts

Use Cases

Split exposed filters across multiple regions

Place primary search filters (like keyword search and category) in the main content area above results, while placing secondary filters (like date range and author) in a sidebar. Each block instance is configured to show only its designated filters.

Separate sort controls from filter form

Display the exposed filters in one location and move the sort by/sort order controls to a different region (such as above the results grid) by creating one block with filters visible and sorts hidden, and another with only sort controls visible.

Combine Views exposed filters with faceted search

Place a subset of Views exposed filters alongside Search API Facets blocks in a sidebar, using only the text search filter from Views while relying on facets for other filtering. Hide redundant filter fields to prevent duplication.

Simplify filter presentation on specific pages

When Views exposed filters are organized into collapsible fieldsets for complex filtering, create a simpler block instance for landing pages that removes the group containers and shows filters in a flat layout.

Create a minimal quick search block

From a View with many exposed filters, create a compact search block in the header or footer showing only the primary keyword search field, hiding all other filters, reset button, and pager options.

Tips

  • The module uses CSS to visually hide non-selected filters rather than removing them from the form. This ensures filter values are preserved when users interact with multiple filter block instances on the same page.
  • Each block instance gets a unique form ID, so multiple instances of the same Views exposed filter block can coexist without JavaScript conflicts.
  • The visibility options for reset button, sort criteria, and pager options only appear in the block configuration if those features are actually enabled/exposed in the View display settings.
  • When distributing filters across multiple blocks, all blocks will submit to the same View and update the results together since they share the same filter form state.
  • The 'Remove form groups' option is useful when your View uses BEF (Better Exposed Filters) or similar modules that group filters into collapsible fieldsets.

Technical Details

Troubleshooting 4
Block does not appear in the block library

Ensure your View has at least one display with exposed filters and the 'Use exposed filters in block' option enabled under Advanced settings in the View display configuration.

Filter visibility options are empty

The View display needs to have exposed filters configured. Add filter criteria to your View and check the 'Expose this filter' option for each filter you want to be able to configure.

Filters in different blocks are not syncing

This is expected behavior. Hidden filters retain their form values, so when any block is submitted, all filter values (including hidden ones) are applied to the View.

Reset button option not showing in configuration

Enable the Reset button in your View's Exposed Form settings (under the view's Advanced settings > Exposed Form > Settings).