Views module provides the ability to site admin to allow users to select the filters and dynamically refine the results based on selection made. This can be achieved using exposed filters in views. By default the exposed form looks like normal form i.e. fields to select filter, Apply button to get refined results, etc.
Using views UI, we can tweak exposed form and do following things, without writing a single line of code:
- Change Apply Button Text
- Remove Apply button and add ajax behavior to filters and sort by options
- Add reset button
- Change Sort by field Label
- Change Ascending/Descending Text value in Sort by
To do above changes Edit your view and click on settings link under Exposed Form settings on right side (screenshot 1):
- Change Apply Button Text :
- Enter the new text in Submit button text field.
- Remove Apply button and add ajax behavior to filters and sort by options :
- Search for Autosubmit checkbox and enable it.
- Also enable Hide submit button checkbox, if you don't want to show Apply button to user.
- Add reset button :
- Search for Include reset button checkbox and enable it.
- To change the reset button text enter new text in Reset button label.
- Change Sort by Label :
- Enter new text in Exposed sorts label field.
- Change Ascending/Descending Text value :
- Search for Expose sort order checkbox and enable it.
- Enabling above checkbox, shows 2 more options for Ascending and Descending text. Enter the value in respective field.