Skip to content

Commit 0ef66e6

Browse files
committed
Page create: automatic title + slug
1 parent 9bf8b2c commit 0ef66e6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

content/docs/3_reference/3_panel/1_blueprints/0_page/reference-article.txt

+16
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,22 @@ The button label changes depending on the status option set:
136136

137137
(image: page-creation-status.png)
138138

139+
<since v="4.1.0">
140+
### Automatic title and slug
141+
142+
The page create dialog also allows you to automatically generate title and/or slug instead of allowing the user to edit them manually. To do so, please define the `title` and/or `slug` suboption as a string template:
143+
144+
```yaml
145+
create:
146+
title: "{{ page.location }} – {{ page.date.toDate('M Y') }}"
147+
slug: "{{ page.location.slug }}-{{ page.date.toDate('Y-m-d') }}"
148+
```
149+
150+
Custom fields from the create dialog will be accessible as Kirby query starting with `page` (in this example the fields `location` and `date`). Moreover you can also use queries accessing information not specific to the page (throught the `kirby` or `site` entry point).
151+
152+
If title and slug are generated automatically and there are no custom fields defined for the page creation dialog, the dialog will be skipped and the page immediately created.
153+
</since>
154+
139155
### Supported field types
140156

141157
Currently, the list of supported field types in the dialog is limited to checkboxes, date, email, info, line, link, list, number, multiselect, radio, range, select, slug, tags, tel, text, toggles, time, url. Custom field types are disabled by default. To enable them, add your field type name to:

0 commit comments

Comments
 (0)