Slug

Creates a URL-safe slug from the content of one of the other fields. This template tag doesn’t display anything on the edit form, it just works in the background and creates the slug for you to use.

You need to also have an attribute for. This is the ID of the field you want to make a slug from.

You can also use a space-separated list of IDs in the for attribute. This will draw content from multiple fields.

Editable slugs

By default, a slug is not editable on the form. If you want to make the slug editable you can set

<perch:content id="slug" type="slug" for="heading" editable>

The field will then appear on the edit form. Don’t forget to set a label for it.

Normally, you don’t want a slug to change once it’s been set. This may be because it forms part of a URL (and you don’t want to break the URL) or it has been referenced in code. Set the indelible attribute to fix the slug once it’s been set. (i.e. allow it to be edited once)