We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20912
    • 21 Posts
    I am having a problem here.

    The code is: [[getResources? &parents=`0` &where=`{"template:=":4, "OR:template:=":8, "OR:template:=":7}` &tpl=`simpleID` &depth=`100` &limit=`0`]]

    The problem is that all these where statements doesn’t effect to the result. Actually I can say that only two of them are affected, but the third one is neglected.

    Can anybody help me?
      • 22303 MODX Staff
      • 10,725 Posts
      The conditions cannot have the same key, i.e. OR:template:= is used twice. You should use template:IN here and an array to represent the values, e.g.
      [[getResources? &parents=`0` &where=`{"template:IN":[4,7,8]}` &tpl=`simpleID` &depth=`100` &limit=`0`]]
        • 20912
        • 21 Posts
        thank you OpenGeek, it works, of course! This is what I was looking for! Tried, but the lack of SQL done its work smiley You are great!
          • 31088
          • 14 Posts
          I’m having a terrible time with the &where...
          I’ve tried the examples in the docs, I’ve now just copied and pasted this example (changing, of course, the template number to match mine) but I must be missing something.

          Here’s what I have now:
          [[getResources? &parents=`1` &where=`{"template:=":2}` &tpl=`Agr.intro.homepage` &depth=`100` &limit=`0`]]

          I’ve tried it without &depth and &limit, as well, and I’ve tried &includeContent=`1`...

          Any ideas?