Version 14.x adds support for managing multiple tables in a single backend module and introduces user-selectable templates.
The BackendControllerInterface method signature changed:
class UserController extends AbstractBackendController
{
- public function getTableName(): string
+ public function getTableNames(): array
{
- return 'fe_users';
+ return ['fe_users'];
}
}Settings are now prefixed with table name using dot notation:
$settings = $this->getModuleData()['settings'] ?? [];
- $offlineRecords = $settings['onlyOfflineRecords'] ?? false;
+ $offlineRecords = $settings[$this->getTableName() . '.onlyOfflineRecords'] ?? false;Settings are transformed into nested arrays via getModuleDataSettingsForView():
- <f:if condition="{settings.onlyOfflineRecords}">
+ <f:if condition="{settings.{table}.onlyOfflineRecords}">The {table} variable contains the current table name and is automatically available.
When storing settings in modifyQueryBuilder(), prefix with table name:
protected function modifyQueryBuilder(): void
{
$body = $this->request->getParsedBody();
if (isset($body['custom_filter'])) {
- $this->addToModuleDataSettings(['customFilter' => $body['custom_filter']]);
+ $this->addToModuleDataSettings([
+ $this->getTableName() . '.customFilter' => $body['custom_filter']
+ ]);
}
}No changes needed - $this->tableConfiguration is automatically scoped to the current table.
The hardcoded template method is replaced with a configurable approach:
Before (hardcoded template):
class UserController extends AbstractBackendController
{
- protected function getTemplateName(): string
- {
- return 'Custom';
- }
+ protected function getTemplateConfigurations(): array
+ {
+ return ['Custom' => []];
+ }
}Refer to the Example Pages Controllers for implementations with multiple templates.
- Update
getTableName()→getTableNames()in your controller - Return array instead of string:
['table_name'] - (Optional) Replace hardcoded
getTemplateName()withgetTemplateConfigurations() - Clear caches:
ddev typo3 cache:flush - Test your module
| Issue | Solution |
|---|---|
Class must implement method getTableNames() |
Change getTableName(): string to getTableNames(): array |
| Settings not in templates | Use {settings.{table}.settingName} instead of {settings.settingName} |
| Settings not persisting | Prefix keys: $this->getTableName() . '.setting' |
| Template dropdown not showing | Override getTemplateConfigurations() with multiple templates |
| Custom template not loading | Ensure template file exists and matches configuration key |
- Example Controllers - Reference implementations
- CHANGELOG.md - Complete list of changes
composer require "xima/xima-typo3-recordlist:^13.0"Then revert getTableNames() back to getTableName(): string.