ds-site/Configuration/TCA/Overrides/sys_category.php
2024-02-08 08:04:56 +01:00

37 lines
1 KiB
PHP

<?php
declare(strict_types=1);
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
(static function (string $tableName) {
ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
'columns' => [
'slug' => [
'label' => '<path-to-locallang-file>.slug',
'exclude' => 1,
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['title'],
'prefixParentPageSlug' => true,
'replacements' => [
'/' => '',
],
],
'fallbackCharacter' => '-',
'eval' => 'uniqueInSite',
'default' => '',
],
],
],
]);
ExtensionManagementUtility::addToAllTCAtypes(
$tableName,
'slug',
'',
'after:title'
);
})('sys_category');