Exposing filters and sorts to users to control listings
The Views module supports exposing filters and sorts on a view display for users to interact with to adjust the results. This can be done to allow users to filter by text or adjust the ordering of the results. In this recipe, we will modify the view used to create a blog page. We will add an exposed search filter and allow the user to sort articles from newest or oldest.
How to do it…
- Go to Structure and then Views. This will bring you to an administrative overview of all the views that have been created.
- Find the Blog view that was created in the first recipe and click on Edit.
- Click on Add in the Filter criteria section of the form.
- In the dialog that opens, we need to make sure we only modify the row format for this display. In the For drop-down menu, select This page (override) so that the changes are only for this page display and not the block display created in the previous recipe.
- Select...