Slug
The
Slug type generates a slug field, which generates a unique string
for the record.
Settings
| Name | Type | Default | Required |
|---|---|---|---|
| string | |||
| boolean | true | ||
| array | |||
| string | |||
| boolean | |||
| array | |||
| object | |||
| object | |||
| string | |||
| boolean | false | ||
| string | |||
| string | |||
| object | |||
| object | |||
| object | |||
| boolean | |||
| boolean | false | ||
| integer | 30 |
eval
-
- Type
- string
unique,uniqueorIn Site unique.In Pid
searchable
-
- Type
- boolean
- Default
- true
If set to false, the field will not be considered in backend search.
generatorOptions.fields
-
- Type
- array
An array of fields to use for the slug generation. Adding multiple fields to the simple array results in a concatenation. In order to have fallback fields, a nested array must be used.
Example:
generatorOptions: fields: - headerCopied!
generatorOptions.fieldSeparator
-
- Type
- string
Separator placed between slug parts built from multiple fields. If a field value contains this character, it is replaced by
fallback.Character
generatorOptions.prefixParentPageSlug
-
- Type
- boolean
Prepends the parent page slug to the generated slug. Only applies to page records.
generatorOptions.postModifiers
-
- Type
- array
List of PHP class names that are called after slug generation to apply custom modifications.
generatorOptions.regexReplacements
-
- Type
- object
Key-value pairs for regex-based string replacement applied during slug generation. Keys are patterns, values are replacements.
generatorOptions.replacements
-
- Type
- object
Key-value pairs for plain string replacement applied to slug parts.
appearance.prefix
-
- Type
- string
A user function that provides a string displayed in front of the input field.
behaviour.allowLanguageSynchronization
-
- Type
- boolean
- Default
- false
Allows to select if localization uses custom or default language value.
default
-
- Type
- string
Default value set if a new record is created.
fallbackCharacter
-
- Type
- string
Character used as a replacement when a slug section contains the
generator.Options. field Separator
fieldControl
-
- Type
- object
See TCA fieldControl.
fieldInformation
-
- Type
- object
See TCA fieldInformation.
fieldWizard
-
- Type
- object
See TCA fieldWizard.
prependSlash
-
- Type
- boolean
Whether the slug field should contain a leading slash. Useful for nested records with speaking URL segments.
readOnly
-
- Type
- boolean
- Default
- false
Renders the field in a way that the user can see the value but cannot edit it.
size
-
- Type
- integer
- Default
- 30
Abstract width of the input field. Minimum
10, maximum50.
Examples
Minimal
name: example/slug
fields:
- identifier: slug
type: Slug
eval: unique
generatorOptions:
fields:
- header
Advanced / use case
name: example/slug
fields:
- identifier: slug
type: Slug
eval: unique
generatorOptions:
fields:
-
- header
- fallbackField
- date