Generates date based archives using Ditto
Mark Kaplan for MODx CMF
2.1.0
If Reflect is not retrieving its own documents, make sure that the Ditto call feeding it has all of the fields in it that you plan on calling in your Reflect template. Furthermore, Reflect will ONLY show what is currently in the Ditto result set. Thus, if pagination is on it will ONLY show that page’s items.
| Reflect Snippet | Generates date based archives using Ditto |
| Parameters | |
| ditto_base | Location of Ditto files |
| config | Load a custom configuration |
| id | Unique ID for this Ditto instance for connection with other scripts (like Reflect) and unique URL parameters |
| getDocuments | Force Reflect to get documents |
| showItems | Show individual items in the archive |
| groupByYears | Group the archive by years |
| targetID | ID for archive links to point to |
| dateSource | Date source to display for archive items |
| dateFormat | Format the [+date+] placeholder in human readable form |
| yearSortDir | Direction to sort documents |
| monthSortDir | Direction to sort the months |
| start | Number of documents to skip in the results |
| phx | Use PHx formatting |
| params | Pass parameters to the Ditto instance used to retreive the documents |
| source | Name of the Ditto snippet to use |
| tplContainer | Container template for the archive |
| tplYear | Template for the year item |
| tplYearInner | Template for the year item (the ul to hold the year template) |
| tplMonth | Template for the month item |
| tplMonthInner | Template for the month item (the ul to hold the month template) |
| tplItem | Template for the individual item |
Location of Ditto files
Any valid folder location containing the Ditto source code with a trailing slash
[(base_path)]assets/snippets/ditto/
Load a custom configuration
| ”default” | default blank config file |
| CONFIG_NAME | Other configs installed in the configs folder or in any folder within the MODx base path via @FILE |
”default”
Unique ID for this Ditto instance for connection with other scripts (like Reflect) and unique URL parameters
Any valid folder location containing the Ditto source code with a trailing slash
| ”” | blank |
ID for archive links to point to
Any MODx document with a Ditto call setup with extenders=`dateFilter`
Current MODx Document
Date source to display for archive items
| # | Any UNIX timestamp from MODx fields or TVs such as createdon, pub_date, or editedon |
”createdon”
Format the [+date+] placeholder in human readable form
Any PHP valid strftime option
”%d-%b-%y %H:%M”
Pass parameters to the Ditto instance used to retreive the documents
Any valid ditto parameters in the format name:value with multiple parameters separated by a pipe (|)
This parameter is only needed for config, start, and phx as you can now simply use the parameter as if Reflect was Ditto
[NULL]
Container template for the archive
See default.tempates.php
Template for the year item
See default.tempates.php
Template for the year item (the ul to hold the year template)
See default.tempates.php
Template for the month item
See default.tempates.php