2

I am using the flag module to toggle a node type 'Task' as Done. I made a view that lists the tasks, and added a views exposed filter for the flag status, which is a boolean field. In this way users can filter the view by selecting True or False for the flag status.

However, I want to change the labels 'True' and 'False' to 'Done' and 'Not Done'

I see no setting in the views exposed filter field that allows to change this setting. Is there another way to do this?

enter image description here

enter image description here

3

There is a number of ways how to do it, check out this thread for a lot of suggested options: Change the '- Any -' text in an exposed taxonomy filter.

You can change the themed output for that form and filter, you need a bit of custom code for that.

You could use Better Exposed Filters module, it lets you override each option text:

Use this field to rewrite the filter options displayed. Use the format of current_text|replacement_text, one replacement per line. For example:

Current|Replacement
On|Yes
Off|No

Without any additional modules or code changes you can use the Flagged Exposed filter Grouped filters option instead of the Single filter you're using now.

The Grouped filters allow you to enter a Label for each grouping. Only in your case you simply select "True" for the first grouping and "False" for the second grouping, which means you haven't grouped anything, you're just repeating the same options from the Single filter:

enter image description here

|improve this answer|||||
  • The last item here should be the first, as it doesn't require additional contrib or custom modules. – colan Feb 11 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.