Subscribe: RSS
  • 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.
    • 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.
      • 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`
        ]]
          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