Feature #90130
openIntroduce option for syncing fields with slug in TCA type "slug"
0%
Description
I propose a new option for the "generatorOptions" config in a TCA slug type to automatically sync changes made in one of the configured fields with the slug. (defaulting to false)
'type' => 'slug',
'config' => [
'generatorOptions' => [
'fields' => ['title'],
'sync' => true,
'replacements' => [
'/' => ''
],
]
'fallbackCharacter' => '-',
'prependSlash' => true,
'eval' => 'uniqueInPid'
]
So if "sync" is set to true, changing the "title" field in a backend form would automatically trigger a "recreate" for the connected slug, to keep the changes in sync.
Updated by Christian Eßl almost 5 years ago
One edge case would be: If the slug was has been manually been overriden before. - Should the syncing be then ignored?
Maybe two different syncing modes: "always sync" and "only sync if was not manually overriden"
Updated by Stephan Bauer almost 5 years ago
This would be great.
It would be possible to set the field to readonly or hide the field.
Updated by Christian Eßl almost 5 years ago
But I think, if this should be a feature in slugs, it should be completely optional, defaulting to FALSE, as you could automatically "destroy" a previously saved slug of a frontend url, that could already have been indexed and out there in the web.
And automatically updating the slug would also require to automatically create a new sys_redirect entry. (As is already done in master, when you change a slug)