Allow choosing the operator for Views contextual filters

Created on 19 October 2020, almost 4 years ago
Updated 17 July 2024, about 2 months ago

Problem/Motivation

Contextual filters in Views always use the equality operator. It would be very useful to be able to choose the operator.

Example use case: Filtering on Content: Changed that is greater-than or equal-to the given date, instead of only being able to filter on equal-to the date.

Proposed resolution

Add support for selecting an operator. Leave the default as equality so that nothing changes unless the site builder chooses a different operator.

Remaining tasks

Implement.

User interface changes

Addition of UI for selecting an operator.

API changes

None.

Data model changes

Optionally store an operator with each contextual filter.

Release notes snippet

Original report

Exposed filters for fields such as dates can have an operator like 'less than' or 'more than'.

I can't seem to find where this would be for contextual filters.

Why: a site builder might want to make views listing of articles older than the current page (node) article.

See also: https://drupal.stackexchange.com/questions/252884/is-there-a-specific-re...

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia silverham

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024