We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    I'm trying to exclude some resources from showing in a resource list tv.
    I used this in the 'where condition' field:

    [{"id:NOT IN":"array(2,4,9,24,25,29,30,35)","AND:published:=":"1","AND:parent:!=":"38"}]
    

    However, this results in no resources being shown at all anymore. Does anyone know if I can use this construction? Or should I do this in a different way?

    This question has been answered by michelle84. See the first response.

      • 42046
      • 436 Posts
      Not 100% sure about getResources but in pdoResources you can use:

      &resources=`-2,-4,-9,-24,-25,-29,-30,-35`


      to exclude those resources.
        • 19328
        • 433 Posts
        Thanks Dan! However I'm not sure we're talking about the same thing. I'm trying to create a tv, your code is for the getResources snippet I think...
          • 42046
          • 436 Posts
          Sorry, my mistake.

          Could you try:

          [{"id:!=":[2,4,9,24,25,29,30,35]}]


          Edit: there's a good post here about json queries and the problems with formatting correctly for lists for resource list TVs.

          http://www.sepiariver.ca/blog/modx-web/modx-quick-tip-resource-list-tvs/
          • discuss.answer
            • 19328
            • 433 Posts
            Thank you very much! I hadn't seen that blog post!

            The solution that's working for me is:

            [{"id:NOT IN":[2,4,9,10,24,25,29,30,35],"AND:published:=":"1","AND:parent:!=":"38"}]