MODX Community

[Output filter or If] Where is the notinarray operator?

Hi :slight_smile:

I want to make a conditionnal check like this :

[[*id:notinarray=`1,19`:then=`[[$chunk]]`]]

or with if addon :

[[!If? &subject=`[[*id]]`
       &operator=`isnotinarray`
       &operand=`1,19`
       &then=`[[$chunk]]`
]]

But the both way seams don’t have this kind of operator !
They both have the inarray operator for maching several resource, but not the negative way !

So two questions :

  • why so much hate ?
  • what is the best /easyer workaround for this purpose ?

I think this should work:

[[*id:inarray=`1,19`:then=``:else=`[[$chunk]]`]]
1 Like

oh… I have to recognize I have sometime difficulties to think out of the box…
Thank Bob :slight_smile:

I’m glad I could help. :wink: