We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41294
    • 34 Posts
    -Parent
      --Container 1
         ---Resource 1
         ---Resource 2
         ---Latest Resource
      --Container 2
         ---Resource 1
         ---Latest Resource
      --Container 3
         ---Resource 1
         ---Resource 2
         ---Latest Resource



    Based on resource structure above. Is it possible using getResources to get only the resources i named "Latest Resource" above?

    So here's my initial snippet tag
    [[!getResources? &parents=`PARENT ID` &tpl=`CHUNK TPL` &hideContainers=`1` &depth=`2`]]


    How am i going to improve my snippet tag or add filters that will only get the latest created resource on every resource container?


    Thanks smiley
      • 32699 ☆ A M B ☆
      • 427 Posts
      Sort them DESC by ID or createon and limit it to 1 if you only want the last one.
        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It's rarely necessary to call getResources uncached, and it can seriously slow down your page loads.

          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