We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36516
    • 179 Posts
    Unfortunately, in the end I had to switch back to getResources because pdoResources simply doesn't support things like default values, or all the comparison operators. I've reported the issue on github and the developer has acknowledged.
      • 54339
      • 0 Posts
      I would just like to add my code to this discussion, even though it is old, as it took me a little while to get it working and it may help someone else... largely based on what sottwell had already written.

      [
      [pdoResources?
      	&parents=`0`
      	&includeTVs=`homepageFeatureCheckbox` 
      	&where=`{"homepageFeatureCheckbox.value":"true"}` 
      	&prepareTVs=`1`
      	&tpl=`tl.pr.news-feature`
      	&limit=`4`
      	&sortby=`{"publishedon":"DESC"}`
      	&includeContent=`1`
      ]
      


      My TV is a simple checkbox within a News post, which is set that if it's checked it will return true. This will then pull up to 4 articles which are selected as true, and provide a Featured News section, for, in my case, the homepage.
        • 3749
        • 24,544 Posts
        Thanks for posting that. I assume that you meant this since both the opening and closing tags in your code would be ignored by the MODX parser:

        [[pdoResources?
            &parents=`0`
            &includeTVs=`homepageFeatureCheckbox` 
            &where=`{"homepageFeatureCheckbox.value":"true"}` 
            &prepareTVs=`1`
            &tpl=`tl.pr.news-feature`
            &limit=`4`
            &sortby=`{"publishedon":"DESC"}`
            &includeContent=`1`
        ]]
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting