Feature: #108027 - Type-specific title in TCA types section
See forge#108027
Description
It is now possible to define a type-specific
title in the TCA
types section. This value overrides the global table title defined in
ctrl for the respective record type.
This allows different record types of the same table to display different titles in the TYPO3 backend user interface, making it clearer which kind of record is being created or displayed.
Note
In addition to
title, the
preview property can also
be overridden per type. This was already possible through explicit evaluation
and use of the Schema API, but is now consistently respected by FormEngine
as well.
Implementation
This feature has been implemented in two areas to ensure consistent behavior:
- Schema API
The
Tcamerges type-specific configuration into sub-schemas usingSchema Factory array_. This makes type-specific titles available throughreplace_ recursive () $schema->get.Title () - FormEngine
The data provider
Tcamerges the type-specificTypes Ctrl Overrides titleandpreviewintoRenderer processedduring form rendering. This ensures that both FormEngine and any legacy code accessingTca ['ctrl'] ctrldirectly will see the correct type-specific values.
Example
return [
'ctrl' => [
'title' => 'my_extension.db:tx_my_table',
'type' => 'record_type',
// ... other ctrl configuration
],
'types' => [
'article' => [
'title' => 'my_extension.db:tx_my_table.type.article',
'showitem' => 'title, content, author',
],
'news' => [
'title' => 'my_extension.db:tx_my_table.type.news',
'showitem' => 'title, content, publish_date',
],
'event' => [
// No type-specific title - will use the global ctrl['title']
'showitem' => 'title, content, event_date',
],
],
// ... columns configuration
];
In this example:
- The article type displays the title defined in the language file key
tx_.my_ table. type. article - The news type displays the title defined in
tx_.my_ table. type. news - The event type falls back to the global table title from
ctrl.['title']
Impact
Tables with multiple record types can now define more specific and descriptive titles for each type in the backend user interface. This improves usability and clarity for editors by making it immediately obvious which type of record is being created or edited.
This feature is especially useful for:
- Content element tables such as
tt_with differentcontent CTypevalues - Tables with distinct record types serving different purposes
- Plugin records with varying functionality per type
- Any table where the record type changes the record's purpose or meaning