Overriding Third-Party Resource Configs
TCA_API mirrors TYPO3's $GLOBALS['TCA'] + TCA/Overrides/ loading
pattern. Any active extension can modify a resource configuration that was
defined by another extension.
How it works
At boot time the loader runs two passes over every active package:
- Base pass — loads every
Configuration/file and writes the result intoTca Api/*. php $GLOBALS['TCA_API']keyed byresourceName. When two packages define the sameresourceName, the last package to load wins (TYPO3 package load order). - Override pass — requires every
Configuration/file (depth 0, sorted alphabetically within each package). Override files are plain PHP side-effects onTca Api/ Overrides/*. php $GLOBALS['TCA_API']— no return value is expected.
After both passes the global is parsed into typed ApiDefinition DTOs and
cached. At runtime, use
Api to read definitions; the
global itself is not guaranteed to be set on cache hits.
Writing an override file
Create a PHP file under Configuration/ in any active
extension. The filename is arbitrary.
Add a column
<?php
declare(strict_types=1);
// EXT:my_ext/Configuration/TcaApi/Overrides/ExtendArticles.php
$GLOBALS['TCA_API']['articles']['columns']['subtitle'] = [
'groups' => ['list', 'show'],
];
Remove a column
unset($GLOBALS['TCA_API']['articles']['columns']['internal_notes']);
Restrict operations
$GLOBALS['TCA_API']['articles']['general']['operations'] = ['list', 'show'];
Change a security role
use MaikSchneider\TcaApi\Enum\AccessRole;
$GLOBALS['TCA_API']['articles']['security']['delete'] = AccessRole::FE_USER;
Add a filter
use MaikSchneider\TcaApi\Filter\ExactFilter;
$GLOBALS['TCA_API']['articles']['filters']['category_id'] = ExactFilter::class;
Multiple overrides for the same resource are applied in alphabetical filename order within a package, and in TYPO3 package load order across packages. The last write always wins.
Explicit vs. implicit mode
The visibility mode — implicit (all TCA columns exposed) vs. explicit
(only columns with groups) — is re-evaluated after all overrides are
applied.
- Adding a column with a
groupskey to an otherwise implicit resource switches it to explicit mode for that resource. - Removing the only column that had
groupsswitches it back to implicit. - Adding a column without
groupsto an explicit resource keeps it explicit; the new column is recorded in the DTO but excluded from all operation outputs.