We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42141
    • 73 Posts
    Hi all smiley,

    Can I use getresources to show the latest added or updated resources (eg. pages/content), with the date mentioned?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, I'm doing something similar this with this getResources call:
      [[!getResources? &parents=`75,78,79` &showHidden=`1` &hideContainers=`1` &sortby=`publishedon` &sortdir=`DESC` &limit=`6` &tpl=`latestDocsTpl`]]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36996
        • 211 Posts
        Yes, you can sort the results by publishedon
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Now if you want it sorted by publishedon or editedon, whichever is more recent, that's another matter. I'm not sure how you would do that. The docs have this example of sorting by multiple fields
          &sortby=`{"publishedon":"ASC","createdon":"DESC"}`
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 42141
            • 73 Posts
            Ah, great! I was suspecting the call would be like the one in the second post. But I wasn't sure if I understood the purpose of the plugin correctly. Thank you, everyone!