diff --git a/website/content/docs/beta-features.md b/website/content/docs/beta-features.md index f44e853efeda..51b06dbb32c4 100644 --- a/website/content/docs/beta-features.md +++ b/website/content/docs/beta-features.md @@ -141,40 +141,6 @@ The above config will transform the title field to uppercase and format the date Available transformations are `upper`, `lower`, `date('')`, `default('defaultValue')`, `ternary('valueForTrue','valueForFalse')` and `truncate()`/`truncate(, '')` -## Dynamic Default Values - -When linking to `/admin/#/collections/posts/new` you can pass URL parameters to pre-populate an entry. - -For example given the configuration: - -```yaml -collections: - - name: posts - label: Posts - folder: content/posts - create: true - fields: - - label: Title - name: title - widget: string - - label: Object - name: object - widget: object - fields: - - label: Title - name: title - widget: string - - label: body - name: body - widget: markdown -``` - -clicking the following link: `/#/collections/posts/new?title=first&object.title=second&body=%23%20content` - -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`. - -**Note:** URL Encoding might be required for certain values (e.g. in the previous example the value for `body` is URL encoded). ## Remark plugins diff --git a/website/content/docs/dynamic-default-values.md b/website/content/docs/dynamic-default-values.md new file mode 100644 index 000000000000..775886150ca8 --- /dev/null +++ b/website/content/docs/dynamic-default-values.md @@ -0,0 +1,38 @@ +--- +title: Dynamic Default Values +group: Fields +weight: 30 +--- + +When linking to `/admin/#/collections/posts/new` you can pass URL parameters to pre-populate an entry. + +For example given the configuration: + +```yaml +collections: + - name: posts + label: Posts + folder: content/posts + create: true + fields: + - label: Title + name: title + widget: string + - label: Object + name: object + widget: object + fields: + - label: Title + name: title + widget: string + - label: body + name: body + widget: markdown +``` + +clicking the following link: `/#/collections/posts/new?title=first&object.title=second&body=%23%20content` + +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`. + +**Note:** URL Encoding might be required for certain values (e.g. in the previous example the value for `body` is URL encoded).