I am encountering a problem with using multiple instance of Ditto (2.0.2 with 0.9.6 RC2).
I have a page with multiple Ditto calls.
The idea is to build a page listing with several categories, with each items belonging to that category listed under it. Funny things is, I have this kind of thing working on a website with Ditto 1 (at the time, you had to use tv prefix and &hiddentv).
I imagine I could have used tags, but never used it thus I went for the "easy" solution : using a dropdown list TV to assign categorie to each item, then use Ditto filtering to sort each category under its title.
Here is what I did
Ditto calls :
<h3>Les enfants</h3>
<ul>[!Ditto? &id=`liste1` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Les enfants,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>Les pieges des ultraviolets</h3>
<ul>[!Ditto? &id=`liste2` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Les pieges des ultraviolets,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>Les effets des surexpositions solaires et le depistage</h3>
<ul>[!Ditto? &id=`liste3` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Les effets des surexpositions solaires et le depistage,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>Pour vous proteger</h3>
<ul>[!Ditto? &id=`liste4` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Pour vous proteger,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>Les lunettes de soleil</h3>
<ul>[!Ditto? &id=`liste5` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Les lunettes de soleil,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>Les cremes solaires</h3>
<ul>[!Ditto? &id=`liste6` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Les cremes solaires,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>Bronzage</h3>
<ul>[!Ditto? &id=`liste7` &parents=`190` &display=`all` &filter=`categorie_info_conseils,Bronzage,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>En mer</h3>
<ul>[!Ditto? &id=`liste8` &parents=`190` &display=`all` &filter=`categorie_info_conseils,En mer,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
<h3>En montagne</h3>
<ul>[!Ditto? &id=`liste9` &parents=`190` &display=`all` &filter=`categorie_info_conseils,En montagne,2` &tpl=`tpl_liste_info_conseils` &noResults=`Aucune info-conseils dans cette catégorie pour le moment` &showPublishedOnly=`1` &hideFolders=`1`!]</ul>
And my ditto template is fairly simple :
<li>[+texte_info_conseils+]</li>
Instead of displaying list as expected, it just display the same list for each items, except the first one which only gets 2 records pulled.
I used the debug console but I fail to make sense out of it...
More probably than not, I have an understanding problem of the filter modes.
At first I tried mode 2, then mode 8 : same result.
I have tried cached and uncached calls : same result.
I am guessing the issue is that placeholders with the same name can’t have multiple values... I have read Mark’s post about using ids for multiple calls but I am not sure how to make it work since you can’t prefix the ditto template placeholders with the unique id.
To use multiple calls add &id=`unique name` to each Ditto call and then prefix all MODx (not Ditto template) placeholders with the id_. So for example if you had the id foo the pagination placeholders would all start with foo_ but the template placeholders like [+date+] would still remain the same.
Any pointer ?
Thanks !