Using template chunks to format output
Ditto sets up placeholders for all the built-in fields and template variables in the retrieved documents. These placeholders can be used to insert the relevant data into output templates specified by the &tpl parameter. Ditto templates (not to be confused with MODx document templates) are usually defined as chunks. &tpl=`myTpl` will look for a chunk called myTpl, and display an error message if it doesn't exist.
The templates merge placeholders with HTML code. Though usually defined in chunks, the HTML can also be defined in files or even in the parameter itself. The fields for each retrieved document are named in the format [+fieldname+]. The default Ditto template is contained in the relevant file in Ditto's "lang" folder (e.g. ditto/lang/english.inc.php), (View template)
Here is an item with a simple template defined in the chunk "ditto.title.date": (View template)
Duis tristique ITEM 463 urna id metus. Maecenas
28-Mar-03 14:02
The same item with a more revealing template (View template):
(Page title) Duis tristique ITEM 463 urna id metus. Maecenas
(Date) 15-Feb-06
(Long title) Titulus longus est LONG TITLE of this item quinquerimnibus
(Intro) Maecenas volutpat. In vitae arcu at quam congue dictum