We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49637
    • 10 Posts
    Hello,

    I would like to ask how it is possible to get the IDs from the latest two resources from an specific parent-ID (by created date)?

    Greets

    Steffen

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

    [ed. note: steffen-s last edited this post 11 years, 9 months ago.]
    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      [[!getResources? &parents=`42` &limit=`2` &tpl=`&CODE [[+id]]`]]

      There are two ways to separate the output, you can use &toSeparatePlaceholders=`phName` which will produce placeholders [[+phName0]] and [[+phName1]] or you can use a separator, for example a comma with &outputSeparator=`,`
        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
        • 49637
        • 10 Posts
        Thanks Susan! This is great!