[[+content_image]]
A
A
Alexander Yank2017-06-05 16:07:23
MODX
Alexander Yank, 2017-06-05 16:07:23

How to display a resource from each parent?

In resource 28 , there are 12 more parents, and they have a bunch of daughters, do I need to display 1 last created resource from each parent?
Here is my code:

[[!pdoResources?
    &parents=`28`
    &limit=`12`
    &tpl=`tpl.newsList`
]]

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
F
Froggyweb, 2017-06-05
@Froggyweb

You need to write your own snippet with a selection of one child resource by date. If it is not important that there is a selection from all daughters, then display pdoResources sorted by date and limit

S
sanch0ss, 2017-06-15
@sanch0ss

what do you have in tpl.newsList?
if you insert
[[!pdoResources?
&parents=`2`
&limit=`1`
&tpl=`tpl.newsList2`
]]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question