Ditto

Last edited by Jay Gilmore on Jun 9, 2014.
This is a user-contributed Extra. If you find issues or would like more info or help, please contact the author.

What is Ditto?

This is the documentation home for the MODx Evolution [Snippet] Ditto; a document aggregator for creating blogs, article and news collections, and more, with full support for templating.

Ditto lists data from documents to create output in many formats. You can specify which documents, you can specify what data, and you can specify the layout of that data.

MODx Evolution comes shipped with Ditto (currently Ditto version 2.1.1) and works straight out of the box; but if needed you can download Ditto from the MODx Extras section. When downloading from the Extras section make sure you get the Evolution compatible version, some of the latest releases are for Revolution only.

Ditto development for MODx Revolution ceased some time ago and is not expected to continue in the future. getResources and getPage replaces most of the functionality.

Getting Started With Ditto

I'll try and cover as many of the basics as I can so you can get started with Ditto straight away, here's an example which you can to get a simple blog working very quickly. I have included a couple of the many parameters you can use to build a highly flexible system.

Call Ditto as you would with any snippet, for example:

[!Ditto? &parents=`5` &extenders=`summary` &tpl=`tplBlog` &orderBy=`createdon ASC` &display=`6` &truncText=`Continue Reading This Article` &dateFormat=`%e %B %Y`!]

In this example, there's I've called a Chunk named "tplBlog" which will determine how each blog summary is displayed, that looks like this:

<h1>[+pagetitle+]</h1>
<p>[+summary+]</p>
<p>[+link+]</p>

See Also

  1. Ditto Extenders
  2. Ditto Parameters

Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).