I am fairly new to Modx and Ditto but need some help! I have searched and read through the forums with no luck.
I need Ditto to display documents on one page but with 2 different templates. One set of documents is "Paid Listings" the other is "Free Listings" - each with a different template but on the same page.
IOW Each different table needs to have a different document displayed inside of it.
After reading through some other posts I made 2 TV’s for the display page and put in the following default Ditto call:
[[Ditto? &parents=`2` &tpl=`tpl_listings_paid` &orderBy=`ASC`!]]
[[Ditto? &parents=`2` &tpl=`tpl_listings_free` &orderBy=`ASC`!]]
This is what’s in the two templates:
`tpl_listings_paid`
<table class="listing_paid" style="height: 233px;" border="0" cellspacing="0" cellpadding="1" width="780">
<tbody>
<tr>
<td>
<p><img src="[+listing_image+]" /></p>
</td>
<td>
<p><strong>[+listing_name+]</strong><br />
[+address_1+]<br />
[+city+], [+province+]<br />
[+postal_code+]<br />
[+phone+]<br />
[+toll_free+]<br />
Email:<a href="mailto:[+email+]">[+email+]</a></p>
</td>
<td>
<p>[+introtext+]<a href="[+url+]" target="_blank"><br /></a></p>
</td>
</tr>
</tbody>
</table>
and
`tpl_listings_free`
<table class="listing_free" border="0" cellspacing="0" cellpadding="1" width="780">
<tbody>
<tr>
<td>
<p><strong>[+listing_name_free+]</strong><br />
[+address_1_free+]<br />
[+city_free+], [+province_free+]<br />
[+phone_free+]</p>
</td>
</tr>
</tbody>
</table>
This is not working. I have 2 documents in the container - one paid and one free. The above outputs the first ’paid’ document then a blank, then second ’free’ document then a blank.
Hope this makes sense.
Any help or suggestions would be appreciated.
Thank you.