Reputation: 2922
I've two collections
In my case, each post can have multiple categories.
Hence the way I'm setting it is Post has a field of type List which is further a Field of type Relation. Is there a straightforward way to specify this relationship?
Thanks
Upvotes: 0
Views: 214
Reputation: 589
The Relation widget has a multiple
option that, when set to true
, will do just that without having to rely on a list
widget.
eg:
fields:
- label: 'Categories'
name: 'categories'
widget: 'relation'
collection: 'categories'
value_field: '{{slug}}'
display_fields: [title]
search_fields: [title]
multiple: true
Upvotes: 0