37 lines
1 KiB
PHP
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');
|