Slug Field Type
Additional attributes, defaults, and usage example for slug fields.
This field should only be used by API CMSs. In general, Netlify Create will inherit the functionality as defined in the CMS's schema.
Usage Example
Here is an example that shows a slug
field on a page.
1
2
3
4
5
6
7
8
9
10
This will render a simple text input with helper text pulled from the (interpolated) urlPath
attribute for that model.
Slug Behavior for Git CMS
When content is stored in files (Git CMS), the slug
is the path to the file relative to pagesDir
, excluding the file extension.
For example, if a content file is stored at the path content/pages/about.md
, and urlPath
is left to the default /slug
, the page will be mapped to the URL /about
.
This behavior cannot be adjusted at this time. It is recommended to use the default slug behavior provided by Netlify Create when storing content in files.
Changing a Slug Value
Typically slugs determine the URL of a page. Because of that, it's generally a dangerous action to change a URL. Netlify Create shows a warning when changing an existing slug value.