Appearance
Repeating Content
Content itself can be generated based on the structure of a press file's data using a <repeat> directive.
The repeat directive can either loop over a data reference by setting the data attribute, or a flow group by setting the group attribute.
The repeat will iterate over the contents of the data reference, assigning this value to a new local variable whose name is provided by the repeat's optional item attribute.
For example,
xml
<press>
<document format="a4">
<page>
<repeat data="data.people" item="person">
<h1>Hello, {{ person.name }}</h1>
</repeat>
</page>
</document>
<data type="json">
{
"people": [
{"name": "Bob"},
{"name": "Alice"}
]
}
</data>
</press>would create a page with two titles, one greeting Bob and another greeting Alice.