We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21872
    • 95 Posts
    Is getResources flexible enough to do with one snippet call (and as few queries as possible) getting the menutitle for each of the 3 parents and the most recent entry from each of the three parents, skipping containers? Or do I need to write my own snippet to do this, or use three instances of getResources?

    My first stab at this looked like:
    [[!getResources? &parents=`6,142,143` &limit=`3` &showHidden=`true` &sortby=`publishedon` &depth=`2` &hideContainers=`true` &tpl=`myTpl`]]

    but that doesn’t seem to be quite right.

    Thanks!



      • 22303 MODX Staff
      • 10,725 Posts
      Can you explain how it is not quite right? That should do it, except be aware you should use 0 or 1 vs. true or false as the values for &showHidden and &hideContainers, e.g. &hideContainers=`1`
        • 21872
        • 95 Posts
        Oh, sorry. It almost does what I was trying to do, I have an event, a blog post, and a press release displaying. I was trying too hard to keep my original question concise and deleted some key information, sorry. What I left out is this: my template chunk needs access to the parent for each iteration.

        essentially, I need a placeholder that gets replaced with the menutitle of the parent id from the parents list in the snippet.

        I also need the output to display in a configurable sequence while still selecting the most recently published resource in each parent.