Feature: #95808 - Enable item groups from foreign tables
See forge#95808
Description
A new TCA option foreign_
has been introduced for the TCA
types select
and category
. It allows extension authors to define a
specific field in the foreign table, holding an item group identifier.
As described in the TCA reference,
this needs to be a string
.
Therefore, it's now possible to also use the item groups feature, introduced with forge#91008, for TCA columns with a foreign table lookup.
Example
'select_field' => [
'label' => 'select_field',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['label' => 'static item 1', 'value' => 'static-1', 'group' => 'group1'],
],
'itemGroups' => [
'group1' => 'Group 1 with items',
'group2' => 'Group 2 from foreign table',
],
'foreign_table' => 'tx_extension_foreign_table',
'foreign_table_item_group' => 'itemgroup'
],
],
In case the foreign_
field of a foreign record
contains an item group identifier, not set in the local item
configuration, the database value will be used as label in the select box,
as it's also the case for static items with a group
set to a value,
which is not configured in item
.
Impact
Using the new foreign_
TCA config option, it's now
possible to use the items group feature even for items from foreign tables.