<![CDATA[ [solved] how to pull each first/newest document from different containers - MODX Community Forums]]> https://forums.modx.com/thread/?thread=42437 <![CDATA[Re: how to pull each first/newest document from different containers]]> https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245711 ]]> anonymized-26931 Aug 04, 2009, 05:11 AM https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245711 <![CDATA[Re: how to pull each first/newest document from different containers]]> https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245710
smiley thank you very much - i’ll test it and report back!!]]>
anonymized-26931 Aug 04, 2009, 04:48 AM https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245710
<![CDATA[Re: how to pull each first/newest document from different containers]]> https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245709
Bookmarked for future reference.]]>
bunk58 Aug 04, 2009, 04:46 AM https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245709
<![CDATA[Re: how to pull each first/newest document from different containers]]> https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245708
I assume that the mentioned documents ("GalleryOverview", "Portraits", "Portrait 01", ...) are all containers. Photos are located under "Portrait 01", "Landscape 01", "Black & White 01", etc. Right? If so, then the task might be solved with something of this kind:

[[Ditto? &parents=`10` &depth=`2` &display=`all` &filter=`isfolder,1,1` &tpl=`newest-photo`]]


The above will catch all containers under "GalleryOverview" for two levels in depth. Now the most important part, content of the "newest-photo" chunk:

[[Ditto? &parents=`[+id+]` &depth=`1` &display=`1` &filter=`isfolder,0,1` &tpl=`PhotoDoc` &sortBy=`createdon` &sortDir=`DESC`]]


This chunk pulls newest (latest) photo doc for the each container caught on the first level of Ditto’s call. I have tested this idea and it is working.]]>
Alik Aug 04, 2009, 04:36 AM https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245708
<![CDATA[ [solved] how to pull each first/newest document from different containers]]> https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245707
i try to accomplish following scenario:

for a photography website i need a gallery-overview page which pulls each newest/first document from its subcontainers/folders without having several Ditto-calls:

GalleryOverview (ID10)
Portraits
- Portrait 01
- Portrait 02
- ...
Landscape
- Landscape 01
- Landscape 02
- ...
Black & White
- Black & White 01
- Black & White 02
- ...

does anyone know how to do this?

and would it be possible to setup ditto, to automatically include a new category (pulling its newest/first document) & without having the client to add the ID of the new category-folder to the Ditto-call (maybe something like &parents=`10` &depth=`3` &hideFolders=`1`?)

thanks, j]]>
anonymized-26931 Aug 03, 2009, 08:07 AM https://forums.modx.com/thread/42437/solved-how-to-pull-each-first-newest-document-from-different-containers#dis-post-245707