Each
Each

Repeat a template per object, or per a single object's links/tags/attributes.

Each repeats its body once per item, exposing the current item to Field, ObjectLink, and If. Write the body once (the per-item template) — the component does the iteration.

Supported props

PropTypeRequiredDefaultPurpose
model_keystringyes*current route modelWhich model to read
objectsstringno**Id mask for iterating over objects
objectstringnoSource object id when iterating a collection
overstringnoobjectslinks, tags, or attributes of object

* Set model_key explicitly on specs pages.

Iterate over objects

<Each model_key="deployment" objects="iomodel.*">

<ObjectLink /> — <Field name="type" />

</Each>

Rendered output:

Iterate over a collection of one object

Set object and over. Field names depend on the collection:

overItem fields
linkslabel, target (target id), type, description
tagsvalue
attributeskey, value
<Each model_key="deployment" object="iomodel.studio" over="links">

<Field name="label" /> → <Field name="target" />

</Each>

Rendered output:

Common pitfalls

  • Each cannot be nested in another Each / ObjectList / ObjectTable
  • objects="*" matches one level only — use ** for nested objects
  • over requires object (the source object whose collection is iterated)

Last updated on