Some exposed filter operators are not particularly useful to the average non-technical website visitor. Also, in my opinion having 11 operators is way too many, overwhelming the visitor. It would be better if the admin could select which exposed filters to show based on context.
In Drupal 8 beta 7
1. Go to /admin/structure/views/view/content
2. Under Filter Criteria, click Add
3. Check Content: Changed
4. Click Apply (all displays)
5. Check Expose this filter
Steps 6-9 necessary until #2248223: Adding a new Views filter and making it exposed returns user back to list of filters is fixed:
6. Click cancel
7. Under Filters, look at Content: Changed (= )
8. Under Filters, click Content: Changed (= )
9. Check Expose this filter
10. Check Expose Operator
11. Click Apply
12. Go to /admin/content
13. Click the dropdown
Actual: Operators shown to visitor:
Is less than
Is less than or equal to
Is equal to
Is not equal to
Is greater than or equal to
Is greater than
Is between
Is not between
Regular expression
Is empty (NULL)
Is not empty (NOT NULL)
"Regular expression" is too technical for most website visitors on a general public website, as are references to NULL. In order to reduce the number of choices, I would also want the option to remove Is less than or equal to, Is not equal to, Is greater than or equal to, Is not between. And NULL and NOT NULL are not useful if the field is required.
Expected: Ability to choose which operators are shown
There is a CSS workaround. In Drupal 7, I am using the following code:
.view.view-calendar-items-by-meeting option[value="<="],
.view.view-calendar-items-by-meeting option[value="!="],
.view.view-calendar-items-by-meeting option[value=">="],
.view.view-calendar-items-by-meeting option[value="not between"],
.view.view-calendar-items-by-meeting option[value="empty"],
.view.view-calendar-items-by-meeting option[value="not empty"],
.view.view-calendar-items-by-meeting option[value="regular_expression"],
.view.view-calendar-items-by-meeting option[value="contains"] {
display: none;
}
Comments
Comment #10
lendudeGood feature request, so good we landed this in #1886018: Make it possible to configure exposed filter operators :)
Closing this as a duplicate.