[FEATURE] Make prepending slash in TCA slug configurable 74/58474/3
authorBenni Mack <benni@typo3.org>
Sat, 29 Sep 2018 19:05:45 +0000 (21:05 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 30 Sep 2018 08:12:37 +0000 (10:12 +0200)
commitce83e3e2746c2fc75c170bafd6ef8e7a394ba435
tree7ba234288b3ad6c6d17570ca16aefa1116fe4e29
parent9376fc233d5385349745f27e1145b6ee92b09f23
[FEATURE] Make prepending slash in TCA slug configurable

A new TCA option for TCA type "slug" is added, called "prependSlash",
which adds a "/" in front of the field. For pages (pages.slug),
this is mandatory and cannot be configured, as the slug field
has to be filled and set to "/" as a base for the root page.

For other database fields, this is optional (and disabled by default),
and can be enabled via "prependSlash" in TCA config.

This option is mostly useful for recursive records, like categories,
but for most "flat" structures like "news" or "events", this is not
suitable. For pages, it is hard-coded and cannot be (un-)set.

Resolves: #86457
Releases: master
Change-Id: I997908ed74af7ca21873b0793674e9185cc581ce
Reviewed-on: https://review.typo3.org/58474
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/core/Classes/DataHandling/SlugHelper.php
typo3/sysext/core/Documentation/Changelog/master/Feature-86457-TCATypeSlugAddsAPrependingSlash.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php