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:
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).