This is part 3 of content repeaters, which describes how to set up more complex repeaters on your page. If you have not yet read parts 1 (Content Repeater basics) or 2 (setting up Content Repeaters) please do so.
As a quick reminder, when editing a HTML Atom on a webpage you will see the editor below. On the editor under the advanced tab there is an insert widget button which when pressed opens up a drop down where you can select Repeater and submit.
Content Repeaters can be used to list out more than just a Single Object or User. They can be used to list all Objects of a certain Object type that are associated by a certain Association type to a root object. It is even possible to nest a Content Repeater inside another Content repeater, I will show an example of this and how to list associations too.
Children Listing Example
After adding a repeater and opening the editor as stated above, select "Children" from the repeater type dropdown. Next select the "Root Object". To do this click the folder icon to open up a system browser to select the Object (Folder in this example). It is also possible to simply type the object id (if you know it) into the box and press enter.
Next select the Object type of the object and you should have something similar to the image below.
From here we can press "Save & Close" and get to putting the content of the repeater together. This part is easier if you maximise the HTML Atom editor as it will give you more space.
Now that we have repeater setup we can give it content. Before you do so it will display "Widget Paceholder".
It is possible to type anything you want into the repeater box but to put a repeated field in it is very simple. On the right of the window there is an arrow and the word "Tools". Clicking on the arrow opens up all of the possible field bindings that the Object Type selected in the config can have. If User fields are shown please click on the repeater again to get your Object Types fields. To add these fields first click where you want the field and then double click on the field that you want. It should look (roughly) like below.
The above content repeater looks like this when out of editor mode:
Nesting Repeaters within Repeaters
For this example I will be continuing from the example above and and adding in the associated Authors of the Documents. This is an example of adding a nested repeater and another assoociation type that isnt Parent-Child.
First add a new repeater where you would like it to appear in the existing repeater and edit it. Then select "Parents Repeater" from the Repeater Type and "Associated Objects" from the Sub repeater type. From here you should select what object type you would like to repeat and the association type that you want, for this example I have chosen Contact and Author(s).
Setup from here is the same as any other content repeater, add the fields and content that you require, press space and you are done. For this example I added a horizontal rule to split each document up.