Relationship Field (PRO)
A link from this record to records of another model — a product to its brand, an article to its authors.
Settings:
| Setting | What it does |
|---|---|
| Relation type | one_to_one, many_to_one, one_to_many, many_to_many |
| Picker | A dropdown, or a modal window for choosing |
| Model | What is being linked to |
| Display field | What the editor sees in the list |
| Value field | What gets saved, id by default |
| Sort by, Direction, Limit | Shape the list offered |
| Condition | A filter, as JSON, so the list offers only what fits |
The type decides the shape of the value: the two *_to_one kinds save a single identifier, the two *_to_many kinds save a list of them and let the editor pick several.
Output:
html
{foreach $authors as $id}
…
{/foreach}The field saves identifiers, not records
What lands in the value is ids — that is all. There is no ready-made snippet that turns them back into rows, so fetch them yourself, by the ids you stored:
html
{pbList(model = 'Author', where = '{"id:IN": ' ~ $authors ~ '}', tpl = 'author')}Plan for that when you choose this field: it links records, it does not join them.