[FEATURE] Add custom generator options via hook 18/60418/5
authorBenni Mack <benni@typo3.org>
Tue, 9 Apr 2019 01:29:22 +0000 (03:29 +0200)
committerSusanne Moog <look@susi.dev>
Mon, 29 Apr 2019 20:40:56 +0000 (22:40 +0200)
commit9896157699a77de185bbc28b9e370c9fef16b629
treebf70d292d6267b8d7047132187795df613031fea
parent082de0c62d78530f192a0832c9e3846ba15bbbae
[FEATURE] Add custom generator options via hook

In order to allow custom functionality like "Skip pages of type XYZ", a new
hook is added to the SlugHelper which can be added via

$GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions']['postModifiers']

The userFunc needs to return the new / modified $slug which is then put through the
sanitize() method.

TYPO3 Core does not provide custom functionality so this hook allows
to build everything a custom installation or extension wants to hook in.

Resolves: #88198
Releases: master, 9.5
Change-Id: Iad548da69ba001c696afd7d7f834d4950318c029
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60418
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Susanne Moog <look@susi.dev>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Susanne Moog <look@susi.dev>
typo3/sysext/core/Classes/DataHandling/SlugHelper.php
typo3/sysext/core/Documentation/Changelog/9.5.x/Feature-88198-TCA-basedSlugModifiersForExtensions.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php