Project

General

Profile

Actions

Feature #90130

open

Introduce option for syncing fields with slug in TCA type "slug"

Added by Christian Eßl almost 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2020-01-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

Actions #1

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"

Actions #2

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.

Actions #3

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)

Actions

Also available in: Atom PDF