revolution icon indicating copy to clipboard operation
revolution copied to clipboard

[OutputFilter] Add 'notinarray' modifier

Open Spheerys opened this issue 1 year ago • 1 comments

Feature request

Summary

Filter results by excluding some results

Why is it needed?

I'm frustrated when I want to filter result by exclude some resource. Example : [[+id:notin=5,15,22:then=Yes, it's not in array]]` The modifier "inarray" exists and works well, but in some case it could be more efficient to use the oposite "notinarray"

Suggested solution(s)

Add the the modifiers notin, NOTIN, notinarray, notinArray with this purpose : Check to see if the value is not in an array (comma seperated)

Spheerys avatar Sep 26 '23 13:09 Spheerys

You can add a modifier via PR, if you have the time. For an example, see the current IN modifier - https://github.com/modxcms/revolution/blob/3.x/core/src/Revolution/Filters/modOutputFilter.php#L699

Ruslan-Aleev avatar Sep 26 '23 18:09 Ruslan-Aleev