-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Docs: migrate Beta Features - Dynamic Default Values (#7060)
- Loading branch information
1 parent
10a7358
commit a3939e0
Showing
2 changed files
with
38 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |