2022-01-29, 14:04

Feb 27, 2012 — Notify Users module, ver. 0.5 released — user can choose between sending single message (...) »

2013-01-28, 08:32

19 студзеня 2013 у Гродне трагічна загінуў паэт, журналіст і мой сябар (...) »

2009-10-14, 07:19

The site Litaratura.org is devoted to Belarusian literary works and translations. (...) »

2009-01-12, 20:46

Late November 2008 marked the 20th anniversary of the official founding of the Belarusian (...) »

Registered User Area Log into This Site
Show Credits... Credits
~ / Public Domain Software / Extensions to Ditto / Newest Documents $_
Newest Documents
Click To View A Full Size Image...
2010-01-10, 15:17

This solution was initially provided to the MODx user Sharkbait who asked „how to pull each first/newest document from different containers”.

I am pasting here the directory structure of Sharkbait’s photo gallery that the solution was designed for:

Example of directory structure

GalleryOverview (id=10)
    Portrait 1
    Portrait 2
    Landscape 1
  Black & White
    Black & White 1

We need to retrieve in a single and concise step newest documents from each folder under „GalleryOverview” — one latest document for each subfolder. This might be done as follows:

Main Ditto call

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

This call of Ditto collects all subfolders under „GalleryOverview” and these collected subfolders are subsequently explored by „newest-doc” chunk for the latest document:

Content of „newest-doc” chunk

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