Search code examples
modx

How to make condition "if collection contains resourse with a TV that is equal to [[*id]]"


I need the following condition in Modx "if collection (resourse #10) contains resourse with a TV that is equal to [[*id]]" then ...

I tried several options but they don't seem to work.


Solution

  • [[!pdoResources?
    &parents=`10`
    &depth=`1`
    &tpl=`nomatter`
    &limit=`1`
    &includeTVs=`TV_NAME`
    &where=`[ "TV":[[*id]] ]`
    ]]
    
    [[+total:gt=`0`:then=`....`]]
    

    https://docs.modx.pro/komponentyi/pdotools/snippetyi/pdoresources