The views_filterblock module basically moves the horizontal filter from the views page content area into a (vertical) block. This differs from the views block option which displays the view exposed filters AND a limited number of rows from views content. It themes the block using collapsible fieldsets rather than the table currently used by views, and it uses some logic to decide which fieldsets should be collapsed or not collapsed based on whether the filter form has a value.
You can do this with some code, for example, see Displaying Views Exposed Filters in a Block. But this module simplifies the process so no coding or theming is required.
- Install this file into the modules directory of your choice (for example, sites/yoursite.com/modules/views_filterblock or modules/views_filterblock).
- Enable the module in the admin/modules page.
- Optionally set the number of blocks you need in admin/settings/views_filterblock.
- Add the 'Views Filter Form' blocks on the admin/block page and configure them. You may want to restrict this block to only display on your views page by using the block configure options, but this is not a requirement.
- Setting the exposed filters 'filter settings default' checkbox, renders the fieldset as not collapsed. All fields with values are also rendered as not collapsed. If you'd like a fieldset to be initially collapsed or not collapsed, play with these settings. But also realize that if the user uses this in combination with views_fastsearch, and selects one of the values, that on the resulting page, that value will be filled in, and the fieldset will not be collapsed.
This module is partially supported by CivicActions.