It would be really handy to be able to exclude contextual filters, as well as including them so we can do things like related views without showing the current node...

Relates to #1119594: Fix Views argument handlers and #1141488: Allow multiple values for contextual filters

Comments

nbucknor’s picture

nbucknor’s picture

Status: Active » Needs review
StatusFileSize
new2.69 KB

Here's a patch to allow the exclude option.

Status: Needs review » Needs work

The last submitted patch, search-api-exclude-contextual-filter.patch, failed testing.

nbucknor’s picture

Status: Needs work » Needs review
StatusFileSize
new2.8 KB

Updated patch for latest dev version

jonloh’s picture

Status: Needs review » Reviewed & tested by the community

Works pretty well with 7.x-1.3. This should be included in the next patch.

drunken monkey’s picture

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Thanks a lot for the patch, and sorry it took me so long to review!
Committed.

However, I shortly had trouble with using both the "Allow multiple values" and the "Exclude" options, because I'd have expected the conjugation (AND vs. OR, depending on whether you use plus signs or commas to separate values) to behave the other way round. Thinking about it, the way it is now is arguably more logical, though. But we might think about swapping this still, or at least documenting it better.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.