Hi
This is a Ditto question. The answer might be different, but… any way:
Imaging the following site structure in the manager:
somePage (1)
someContainer (2)
someContainer->subContainer1 (3)
someContainer->subContainer1->page (4)
someContainer->subContainer1->page (5)
someContainer->subContainer1->page (6)
someContainer->subContainer2 (7)
someContainer->subContainer2->page (8 )
someContainer->subContainer2->page (9)
someContainer->subContainer2->page (10)
someContainer->subContainer3 (11)
someContainer->subContainer3->page (12)
someContainer->subContainer3->page (13)
someContainer->subContainer3->page (14)
Assume that each “page (id: 4|5|6|8|9|10|12|13|14)” has an assigned TV called image and holds the file path.
In the “somePage (1)” document, I would like to call a Ditto that matches the first “page (4|8|12)” in each “subContainer (3|7|11)” of “someContainer (2)” to retrieve the image TV.
Is this manageable? If it is: how?
The simple way: Use multiple Ditto calls:
&parents=`3` &display=`1` &id=`1` &tpl=`DittoTemplate`
&parents=`7` &display=`1` &id=`2` &tpl=`DittoTemplate`
&parents=`11` &display=`1` &id=`3` &tpl=`DittoTemplate`
and in DittoTemplate use [+MyTV+]
http://ditto.modxcms.com/tutorials/creating-a-custom-template.html
This could probably be done by filtering too.
http://ditto.modxcms.com/tutorials/basic_filtering.html