diff --git a/content/docs/dynamic-default-values.md b/content/docs/dynamic-default-values.md index 77588615..8a0a2722 100644 --- a/content/docs/dynamic-default-values.md +++ b/content/docs/dynamic-default-values.md @@ -35,4 +35,36 @@ clicking the following link: `/#/collections/posts/new?title=first&object.title= will open the editor for a new post with the `title` field populated with `first`, the nested `object.title` field with `second` and the markdown `body` field with `# content`. +Here's an example using a multiple relation field. Given the configuration: + +```yaml +collections: + - name: posts + label: Posts + folder: content/posts + create: true + fields: + - label: Title + name: title + widget: string + - label: Authors + name: authors + widget: relation + collection: "authors" + value_field: "name" + multiple: true + - name: authors + label: Authors + folder: content/authors + create: true + fields: + - label: Name + name: name + widget: string +``` + +clicking the following link: `/#/collections/posts/new?authors=first&authors=second` + +will open the editor for a new post with the `authors` field populated with any pre-existing authors whose names match `first` and `second`. + **Note:** URL Encoding might be required for certain values (e.g. in the previous example the value for `body` is URL encoded).