Slug field

SlugFieldDefinition is a special type of text field provided by the Content Editor module. It creates an editable text field that allows you to adjust the URL of a Content Editor story to a more human-readable form, for example from

example.com/stories/flying-grand-canyon-and-southwest.html

to

example.com/stories/fly-grand-canyon

The same can be achieved with URI mapping, which is a more generic solution. For more details, see the section A user-friendly path vs full path.

The slug field can only be used in the context of the Content Editor module.

Example definition

(Excerpted from the Stories app configuration.)

/stories-app/apps/stories.yaml
datesAndUrl:
...
  properties:
...
    jcrName:
      $type: slugField
      label: URL slug
      placeholder: Add URL slug...

Since the field extends TextFieldDefinition, you can use the text field properties to configure the field.

Related topics
Feedback