ds-site/Configuration/TCA/Overrides/sys_category.php

38 lines
1 KiB
PHP
Raw Normal View History

2019-11-15 13:17:22 +01:00
<?php
2024-02-08 08:04:56 +01:00
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], [
2019-11-15 13:17:22 +01:00
'columns' => [
'slug' => [
'label' => '<path-to-locallang-file>.slug',
'exclude' => 1,
'config' => [
'type' => 'slug',
'generatorOptions' => [
'fields' => ['title'],
'prefixParentPageSlug' => true,
'replacements' => [
'/' => '',
],
],
'fallbackCharacter' => '-',
'eval' => 'uniqueInSite',
2024-02-08 08:04:56 +01:00
'default' => '',
2019-11-15 13:17:22 +01:00
],
],
],
]);
2024-02-08 08:04:56 +01:00
ExtensionManagementUtility::addToAllTCAtypes(
2019-11-15 13:17:22 +01:00
$tableName,
'slug',
'',
'after:title'
);
})('sys_category');