Views exposed filter blocks
Provides a block type that renders Views exposed filters separately from the view, working with all view display types.
views_exposed_filter_blocks
Install
composer require 'drupal/views_exposed_filter_blocks:8.x-1.5'
Overview
Views exposed filter blocks provides a dedicated block type that allows you to place Views exposed filter forms anywhere on your site, independent of where the view results are displayed. Unlike the core Views exposed filter block option which only works with Page displays, this module works with all types of view display plugins including EVA (Entity Views Attachment), embed displays, and any custom display plugins.
The module takes a different approach than similar modules: instead of configuring which block should receive the exposed filters within the view settings, you configure which view's exposed filters should be rendered within the block's configuration. This provides more flexibility in how you structure your site's layout.
The block programmatically builds the Views exposed filter form using Drupal's form builder and respects the view's custom URL settings for form actions. This makes it possible to have the filter form on one page that submits to a results page on a different URL.
Features
- Provides a configurable block that renders any view's exposed filter form
- Works with all view display types including EVA, embed, and custom display plugins
- Block configuration allows selecting any enabled view and display combination
- Supports custom URL form actions for cross-page filtering scenarios
- Optional form state processing for handling submitted values within the block
- No caching ensures filter selections are always current
- Validates view and display existence during block configuration
Use Cases
Sidebar filters for embedded views
When using EVA or similar modules to embed view results within content, you can place the exposed filters in a sidebar block while the results appear in the main content area. This creates a more traditional search interface layout.
Cross-page filtering
Configure a view with a custom URL setting and place the exposed filter block on a landing page. Users can set filter criteria on the landing page, and upon submission, they are directed to the results page with filters applied.
Multiple filter blocks for the same view
Place multiple instances of the filter block in different regions or on different pages, all pointing to the same view. This allows users to access filters from various locations on your site.
Replacing page view filter placement
For page views where you want the exposed filters in a specific block region rather than above the results, use this module to gain complete control over filter placement while maintaining full functionality.
Tips
- Disable AJAX on views when using this module for proper form submission behavior
- For page display views, consider using the built-in 'Exposed form in block' option instead, as it may be more appropriate
- The block cache is disabled by default to ensure filter selections are always current - consider the performance implications for high-traffic sites
- Use the custom URL feature in view display settings when you need the filter form on a different page than the results
Technical Details
Troubleshooting 4
Ensure both the filter block and the view results are on the same page, or configure a custom URL in the view's display settings. Also verify that AJAX is disabled on the view.
Make sure the 'Always process form state' option is enabled in the block configuration if you need submitted values to display in the form.
The configured view or display may have been deleted. Edit the block configuration and select a valid view and display combination.
Configure the 'Link display' option in your view's display settings to 'Custom URL' and specify the correct destination URL.