This is a field plugin that automatically creates slug from defined fields.
Can be used to update page slug and title, client side.
- extract to
your-site/site/plugins/auto-slug
- set
type
field prop toauto-slug
- set
uses
field prop to fields you want to use for slug creation - if you want to automatically update page slug, set
update-slug
field prop totrue
- if you want to generate and automatically update page title, set
shows
field prop to fields you want to use for title creation, and setupdate-title
field prop totrue
Note:
- To avoid possible conflicts use ie. AutoID as one of the fields.
- By setting
update-slug
andupdate-title
page data is modified
your-auto-slug-field:
type: auto-slug
label: Auto URL
uses:
- model
- year
your-auto-slug-field: model-2019
your-field:
type: auto-slug
uses:
model
year
autoid
update-slug: true
shows:
make
model
year
update-title: true
page: {
slug: model-2019-zpxl0tjp
title: Make Model 2019
content: {
your-field: model-2019-zpxl0tjp
}
}
- randomness
- dx
MIT