NOTE: Please understand that this page is a work in progress. We appreciate your patience.

This page outlines the various exposed form options available when using the Better Exposed Filters module.

There are several supported versions of Drupal, Views, and BEF. In general, Drupal 6.x versions of BEF are not open to new features unless a request is accompanied by a patch. Most new development is taking place in the Drupal 7.x branch.

Most BEF features are available with filters that have a limited number of options. In general an open-ended filter, such as a publication date, cannot be tweaked by BEF. There is work in the 7.x branch to add jQuery UI widgets for some of these fields (e.g.: a date-picker for publication date fields) to make date entry easier, however that functionality will not be backported to 6.x because of the lack of jQuery UI components in core.

Drupal 6.x, Views 2.x, BEF 6.x-2.x

Add a filter to your view and click the expose button. You will see additional options in the Configure filter... section:

  • Checkboxes/Radio buttons: This option is available for any filter that has a limited number of options. Tick the Force single option to use radio buttons, untick it for checkboxes.
  • Nested Checkboxes/Radio Buttons: While this option shows for any filter that the regular checkboxes option shows for, it's really only of use for taxonomy filters with hierarchy. If you're using a taxomomy filter with Selection type set to Dropdown and Show hierarchy in dropdown ticked, these filters will be rendered as nested, unordered lists. Tick the Force single option to use nested radio buttons
  • Hidden: Useful for making multi-page searches so that one page can pass settings along to the next page. See this comment for more details.

Views 3.x

Views 3.x introduced the concept of an exposed form plugin allowing us to add many more options to BEF beyond just filters. So now we can tweak exposed sorts and exposed pagers in addition to exposed filters. (And yes, I briefly considered changing the name to Better Exposed Forms, but didn't for legacy reasons).

The biggest user interface change was moving BEF settings from the filter configuration form to the Exposed form settings form. Your filter-specific settings, such as single/multiple select, are still in the filter configuration dialog. Once you've added filters to your view, click the entry for Exposed form style (in the left column in Drupal 6, in the Advanced section in Drupal 7) and select Better Exposed Filters, then click the settings link (gear icon in Drupal 6, BEF Settings link in Drupal 7).

Drupal 6.x, Views 3.x, BEF 6.x-3.x

Drupal 7.x, Views 3.x, BEF 7.x-3.x

With the inclusion of jQuery UI as part of Drupal 7 core, we are now able to access a much larger selection of widgets for use with Better Exposed Filters.

The follow options are available for your exposed filters on Drupal 7.x with Views 3.x:

  • Checkboxes/Radio buttons: This option is available for any filter that has a limited number of options. In the filter configuration dialog, tick the Allow multiple selections option to use checkboxes, untick it for radio buttons.
  • Links: Styles your filters as links which toggle a given option on/off. Works with both single and multiple selections. Note: there are problems with using the Link style with the Autosubmit option.
  • Hidden: Useful for making multi-page searches so that one page can pass settings along to the next page. See this comment for more details.
  • Nested Checkboxes/Radio Buttons: This option is only available to taxonomy-based filters and requires that Selection type be set to Dropdown and Show hierarchy in dropdown be ticked in the filter configuration dialog. Options will be rendered as nested, unordered lists of either checkboxes or radio buttons. To get nested links from a taxonomy filter, see this possible solution.
  • Single on/off checkbox: This option is only available to Yes/No (boolean) filters such as Node:Published where the Allow multiple selections option is unticked in the filter configuration dialog. Note: there are problems with filters that have a default value because unticked checkboxes are not included when the exposed form is submitted.
  • jQuery UI Datepicker: For date-based filters (either core or through the Date module) textfield filters can be transformed into Datepickers by using this option.
  • jQuery UI Slider: For numeric filters, a jQuery Slider option is now available (currently only in the -dev release). This feature was developed by rooby with sponsorship from herd45.

As of beta2, there is now an option move some exposed form elements into a secondary options section. Use this option to move some filters into an "Advanced Search Options" collapsible fieldset to simplify your form. When you tick the Enable secondary exposed form options option, a This is a secondary option checkbox will show in the More Options section (Advanced Sort Options for sort elements). Any element with this option ticked will be moved to a collapsible fieldset and displayed right after the exposed filters on the form.

Comments

nmwd’s picture

I am unable to get the single on/off checkbox working properly. I'm adding a filter for a boolean field but when I untick "Allow multiple selections", I only get three radio buttons:

  • Label
  • Off
  • On

The desired outcome is only one checkbox with the Label next to it. Am I missing something here? I have the correct version of Drupal, Views and BEF.

Cocorev’s picture

I guess you should go to EXPOSED FORM section , click on BEF settings and there select a display format for your boolean field.

jyoti_drupal’s picture

I need Reset Button to use Ajax instead of page load.
Any configuration of that?
I am using Drupal 9(9.4.6).