Exposed filters
On the configuration page of a view (for example, /admin/structure/views/view/trips/edit/all
), you can set which filters to expose to the end users:
Figure 8.9 – Configuration for exposed filters
For the Trips view, we want to allow an end user to filter the results by Duration and Level. With this configuration, the Views module passes a tailor-made form to the exposed
variable of the views_view
theme hook.
The views_exposed_form
theme hook manages the template for the filter’s form. Possible suggestions are as follows:
views
-
exposed
-
form
-
trips
-
all
.html.twig
views
-
exposed
-
form
-
all
.html.twig
views
-
exposed
-
form
-
trips
-
page
.html.twig
views
-
exposed
-
form
-
page
.html.twig
views
-
exposed
-
form
-
trips
.html.twig
views
-
exposed
-
form
.html.twig
Like the other theme hooks provided by Views, you have a lot of combinations to choose from when overriding the base template.
templates/views/views-exposed-form...