2010-09-08, 14:01

Aug 30, 2010 — glossaryFilter has been updated — now it has new forceUTF8 parameter. (...) »

2009-11-03, 08:40

On November 1, 2009, I bought and configured an additional domain for all web services (...) »

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
Show Donation/ Payment Page... Donate/ Pay
Worthwhile Software
Refresh My Local Time (GMT+1)... 2010-09-08, 14:01
  • Russian Federation (1)
    United States (5)
  • Today (135)
  • Yesterday (209)
~ / 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)
  Portraits
    Portrait 1
    Portrait 2
    ...
  Landscape
    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`]]

Write a comment
  • Required fields are marked with *.
  • Comments are published after the approval of the site moderator, who is a human rather than a wind-fast computer program so please be patient. Off-topic comments are definitely removed.

* Code:
 
Enter this code into the appropriate field of the form while submitting an e-mail or a comment. If you have trouble with reading it, generate another...