Greetings. I have done a fair amount of hunting through the Ditto documentation, associated forum postings, and wiki, and I am still pretty unclear as to how I can use Ditto to display news item summaries on the Home page for my site. I am running MODx 0961p2
This is what I have done thus far:
1. In the main document tree, I created a news directory to hold all news item documents.
2. I created a new document to correspond to the first news item and populated the document with the news content.
3. I placed the new document in the news directory
3. I placed the following Ditto call within the main site template: [[Ditto?parents=`5` &extenders=`summary`]]
Although the output for this call does provide a link to the actual News Item document, there is no summary whatsoever. The output also includes the date as well as some notation indicating the the entry was created by the default admin account. All i really want to show up for each news item is a title for the item, a date, a summary, and then a link that allows a visitor to then view the entire news item.
I get the sense that I am missing some critical ’high-level’ understanding here and it is not coming to me by reading the existing documentation. Any guiding comments, insights, or directions would be greatly appreciated.
Yes, you need a little more than that.

First of all you need a template, that is a chunk of HTML code to show the Ditto call how to present the data on the website. You call it with &tpl=`yourTemplate` within your Ditto call, and the chunk is stored in the Chunks tab under Resources in the manager-backend.
Here is an example from the documentation on
http://ditto.modxcms.com:
[[Ditto?parents=`0`&depth=`0`&tpl=`list_li`&display=`all`&filter=`hidemenu,0`]]
And here is another example from my own news section:
[!Ditto? &parents=`335` &tpl=`main_news` &showInMenuOnly=`1` &sortBy=`createdon` &pagination=`0` &display=`8` &depth=`2` &hideFolders=`1` &sortDir=`DESC`!]
You’ll find an explanation on the different parameters
here.
Good luck.
I think, thererfor I am! But what I am, and why...?
tkfm -
Thank you very much! I have made a lot of headway here and am now able to get a summary of a news item to display on my Home page. I do have an additional question now though:
I am currently using the [+link+] placeholder in my Ditto call. This means (of course) that a ’read more ...’ link is available at the bottom of the news summary. Furthermore, when this link is clicked, the browser navigates away from the Home page (where the item summary is listed) and opens the page that lists the entire news item. How difficult would it be to have the news item display right on the Home page, rather than open in a new page altogether? Ideally, what I would like is to have the full News item display in place of the News summary itself? (The News summary sits between a particular set of Div tags on the Home page.)
I am thrilled to have finally gotten the Ditto call to work. Now it is just a matter of getting some remaining behavioral and formating details down.
Most likely you would need to attach a Javascript function to the [+link+] in your Ditto template to load the full news page into a <div>.
Have a look at Mootools or one of the other JS libraries, they all have that capability.
bunk58 -
Thanks for the tip. I will look into MooTools a bit, although I am really not much of a programmer. Perhaps Ditto already provides a way to set a Div within a specific document as the Target in which a news item displays (I will look into that some more too).
bunk58 -
That is not exactly what I had in mind, but it is very elegant; I like it. My initial idea was to have the full News content completely replace the Summary content (rather than display below it). For the time being I have actually gone with a simpler approach and have the full News content display on a new page. So, i take it that you used some javascript to change the display on the full articles from hidden to show.
Thanks bunk58.
- Marconi