MODX getResources filter

501 Views Asked by At

I need to filter my getResources so that the [[*longtitle]]s of filtered resources match [[*pagetitle]] of the resource where getResources snippet is used.

Can this be done?

Thanks

1

There are 1 best solutions below

1
On BEST ANSWER

The docs seem to indicate that you can:

WHERE : A JSON-style expression of criteria to build any additional where clauses from. See below for an example. See display/xPDO20/xPDOQuery.where

So try something like:

[[!getResources?  &where=`{"longtitle":[[*pagetitle]]}`]]

you might need quotes around the pagetitle.