Block Settings

Provides a block type which renders views display exposed filters separately from the view.
It's like Views Block Exposed Filter Blocks module but works for all types of view display plugins (for example for eva view displays which was what I needed) and solves the problem "the other way around".
With this module you select the view and display with the exposed filters to render within the block configuration, not within the view.

If you only need exposed filters in blocks for a views block display plugin, I suggest to use https://www.drupal.org/project/views_block_filter_block or simply try out which of those two fits best.

Based on the implementations like:
https://blog.werk21.de/en/2017/03/08/programmatically-render-exposed-fil...
or
https://drupal.stackexchange.com/questions/236576/render-exposed-filter-...
Thanks to the authors!

Installation & use

  1. Enable the module
  2. Go to block layout (admin/structure/block)
  3. Add a block of type views_exposed_filter_blocks
  4. Select the view & display which holds the exposed filters
  5. Place the block into the region where to display the exposed filters and eventually configure display rules / paths.
  6. Disable AJAX in the view you'd like to use (with ajax is untested)
  7. Place block and result view on the same page so that the filter arguments can be handled by the result view

Additional note:
For some cases it seems that you have to use the "master" view display as result display. You may want to hide the masters exposed filters from output by overwriting

views-view--your-view-name.html.twig

and replacing
{{ exposed }}
with

{# Hide exposed filters. They are shown in a seperate block using views_exposed_filter_blocks: #}
  {#{ exposed }#}
  • Remember to disable AJAX for the selected views, otherwise this currently won't work
  • As it seems this module doesn't work anymore combined with Better exposed filters because BEF requires AJAX to be enabled in some cases!

Alternative modules

Drupal 7

This module will never have a Drupal 7 release. Simply use the great https://www.drupal.org/project/views_block_filter_block

Future plans

If it makes sense we should perhaps add the option to set a target URL for the form submit to make it possible to place the exposed filter block on a page different from the results.

Development proudly sponsored by German Drupal Friends & Companies:

webks: websolutions kept simple (https://www.webks.de)
and
DROWL: Drupalbasierte Lösungen aus Ostwestfalen-Lippe (OWL), Germany (https://www.drowl.de)

Supporting organizations: 
proudly developed this module for the Drupal Community!
AttachmentSize
views_exposed_filter_blocks.PNG41.83 KB

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon6,725 sites report using this module
  • Created by Anybody on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases