selectMultipleSideBySide
This page describes the select type with
'render.
The according database field is generated automatically.
It displays two select fields. The items can be selected from the right field. All selected items are displayed in the left field.
Table of contents:
Example: Basic side-by-side select field
The equipment of a talk
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
'equipment' => [
'label' => 'my_extension.db:talk.equipment',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'items' => [
['label' => 'my_extension.db:talk.equipment.audio', 'value' => '--div--'],
['label' => 'my_extension.db:talk.equipment.handheld_microphone', 'value' => 'handheld_microphone'],
['label' => 'my_extension.db:talk.equipment.headset', 'value' => 'headset'],
['label' => 'my_extension.db:talk.equipment.video', 'value' => '--div--'],
['label' => 'my_extension.db:talk.equipment.projector', 'value' => 'projector'],
['label' => 'my_extension.db:talk.equipment.video_recording', 'value' => 'video_recording'],
],
'size' => 5,
'autoSizeMax' => 10,
'multiple' => true,
'multiSelectFilterItems' => [
['label' => '', 'value' => ''],
['label' => 'my_extension.db:talk.equipment.microphone', 'value' => 'microphone'],
['label' => 'my_extension.db:talk.equipment.video', 'value' => 'video'],
],
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
],
]);
ExtensionManagementUtility::addToAllTCAtypes(
'tx_myextension_talk',
'equipment',
'talk,workshop',
'before:--div--;core.form.tabs:access',
);
For more examples see also the advanced examples.
Properties of the TCA column type select with renderType selectMultipleSideBySide
| Name | Type | Scope |
|---|---|---|
| boolean | Proc. | |
| string (keyword) | Display / Proc. | |
| integer | Display | |
| boolean | Proc. | |
| integer | Proc. | |
| string | Display / Proc. | |
| boolean | Display | |
| string (list of) | Display / Proc. | |
| array | ||
| array | ||
| array | ||
| array | Display | |
| string | Display / Proc. | |
| integer | Display / Proc. | |
| string | Display / Proc. | |
| string (table name) | Display / Proc. | |
| plain text label or label reference | Display | |
| string (SQL WHERE) | Display / Proc. | |
| array | Display / Proc. | |
| array | Display / Proc. | |
| string (class->method reference) | Display / Proc. | |
| integer > 0 | Display / Proc. | |
| integer > 0 | Display | |
| string (table name) | Proc. | |
| array | Display / Proc. | |
| string (field name) | Proc. | |
| array | Proc. | |
| string (SQL WHERE) | Proc. | |
| boolean | Display / Proc. | |
| array | Display | |
| boolean | Display | |
| string | Proc. | |
| boolean | Display | |
| integer | Display |
-
- Type
- boolean
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['allowNonIdValues']
- Scope
- Proc.
- RenderType
- all
Only useful if foreign_table is enabled.
If set, then values which are not integer ids will be allowed. May be needed if you use itemsProcFunc or enter additional items in the items array to produce some string-value elements for the list.
Note
If you mix non-database relations with database relations like this, DO NOT use integers for values and DO NOT use "_" (underscore) in values either! Will not work if you also use "MM" relations!
-
- Type
- string (keyword)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['authMode']
- Scope
- Display / Proc.
- RenderType
- all
Authorization mode for the selector box. The only possible option is:
- explicitAllow
- All static values from the "items" array of the selector box will be added to a matrix in the backend user configuration where a value must be explicitly selected if a user (other than admin) is allowed to use it!)
-
- Type
- integer
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['autoSizeMax']
- Scope
- Display
The maximum size (height) of the select field.
The size of the select field will be automatically adjusted based on the number of selected items. The select field will never be smaller than the specified size and never larger than the value of
auto.Size Max Note
Only has an effect if maxitems is greater than 1.
-
-
- Type
- boolean
- Default
- false
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']['allowLanguageSynchronization']
- Scope
- Proc.
Allows an editor to select in a localized record whether the value is copied over from default or source language record, or if the field has an own value in the localization. If set to true and if the table supports localization and if a localized record is edited, this setting enables FieldWizard LocalizationStateSelector: Two or three radio buttons shown below the field input. The state of this is stored in a json encoded array in the database table called
l10n_. It tells the DataHandler which fields of the localization records should be kept in sync if the underlying default or source record changes.state EXT:my_extension/Configuration/TCA/Overrides/270-tx_myextension_talk-equipment.php<?php use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [ 'equipment' => [ 'label' => 'my_extension.db:talk.equipment', 'config' => [ 'type' => 'select', 'renderType' => 'selectMultipleSideBySide', 'items' => [ ['label' => 'my_extension.db:talk.equipment.audio', 'value' => '--div--'], ['label' => 'my_extension.db:talk.equipment.handheld_microphone', 'value' => 'handheld_microphone'], ['label' => 'my_extension.db:talk.equipment.headset', 'value' => 'headset'], ['label' => 'my_extension.db:talk.equipment.video', 'value' => '--div--'], ['label' => 'my_extension.db:talk.equipment.projector', 'value' => 'projector'], ['label' => 'my_extension.db:talk.equipment.video_recording', 'value' => 'video_recording'], ], 'size' => 5, 'autoSizeMax' => 10, 'multiple' => true, 'multiSelectFilterItems' => [ ['label' => '', 'value' => ''], ['label' => 'my_extension.db:talk.equipment.microphone', 'value' => 'microphone'], ['label' => 'my_extension.db:talk.equipment.video', 'value' => 'video'], ], 'behaviour' => [ 'allowLanguageSynchronization' => true, ], ], ], ]); ExtensionManagementUtility::addToAllTCAtypes( 'tx_myextension_talk', 'equipment', 'talk,workshop', 'before:--div--;core.form.tabs:access', );
-
- Type
- integer
- Default
- 255
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['dbFieldLength']
- Scope
- Proc.
New in version 13.0
As TYPO3 takes care of generating the according database field for
selectfields since TYPO3 v13, a developer can adjust the length of the database field with this option in TCA directly.The TCA config option
dbcontains an integer value that is applied toField Length varcharfields (nottext) and defines the length of the database field. It will not be respected for fields that resolve to an integer type. Developers who wish to optimize field length can usedbforField Length type=selectfields to increase or decrease the default length.
'dbFieldLength' => 1000,
-
- Type
- string
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['default']
- Scope
- Display / Proc.
- RenderType
- all
Default value set if a new record is created. If empty, the first element in the items array is selected.
-
- Type
- boolean
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['disableNoMatchingValueElement']
- Scope
- Display
- RenderType
- all
If set, then no element is inserted if the current value does not match any of the existing elements. A corresponding options is also found in Page TSconfig.
-
- Type
- string (list of)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['exclusiveKeys']
- Scope
- Display / Proc.
List of keys that exclude any other keys in a select box where multiple items could be selected.
-
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
- Scope
- Display
- Types
- group
Button control that adds a related record. Leaves the current view and opens a new form to add a new record. On 'Save and close', the record is selected.
Note
The add record control is disabled by default, enable it with disabled.
-
- Type
- boolean
- Default
- true
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['disabled']
- Scope
- Display
Disables the field control. Needs to be set to
falseto enable the Create new button
-
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']
-
- Type
- string
- Default
- ###CURRENT_PID###
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']['pid']
- Scope
- Display
- Values
- marker or an integer
pid of the new record. Can be a hard pid or a marker. See select foreign_table_where.
Takes the value of "current pid" if not set, forces pid=0 if records from this table are only allowed at root level.
###CURRENT_PID### ###THIS_UID### ###SITEROOT###
-
- Type
- string
- Default
LLL:core. core: labels. create New - TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']['title']
- Values
- plain text label or label reference
Sets the 'title' attribute of the popup icon.
-
- Type
- string
- Default
- append
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']['setValue']
- Values
- string
Can be one of 'set', 'prepend' or 'append'. 'Set' substitutes the new record for the selected record, 'prepend' adds the new record to the top of the list and 'append' adds it at the bottom.
Example: Multiple sidebyside select field with "Add record" enabled
The speakers of a conference with field controls
EXT:my_extension/Configuration/TCA/Overrides/125-tx_myextension_conference-speakers.php<?php use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [ 'speakers' => [ 'label' => 'my_extension.db:conference.speakers', 'config' => [ 'type' => 'select', 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'tx_myextension_speaker', 'MM' => 'tx_myextension_conference_speaker_mm', // Speakers in the default language, not their translations 'foreign_table_where' => 'AND {#tx_myextension_speaker}.{#sys_language_uid} IN (-1, 0) ORDER BY tx_myextension_speaker.name', 'size' => 5, 'autoSizeMax' => 20, 'fieldControl' => [ 'editPopup' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.edit', ], ], 'addRecord' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.add', // A new speaker comes first in the list of selected speakers 'setValue' => 'prepend', ], ], 'listModule' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.list', ], ], ], ], ], ]); ExtensionManagementUtility::addToAllTCAtypes( 'tx_myextension_conference', 'speakers', '', 'before:--div--;my_extension.db:tab.details', );Example: Select field with optionsThe
addcontrol of the speakers of a conference also sets options. TheRecord titleoption changes the title of the button. Withsetset toValue prepend, a new speaker comes first in the list of selected speakers:EXT:my_extension/Configuration/TCA/Overrides/125-tx_myextension_conference-speakers.php<?php use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [ 'speakers' => [ 'label' => 'my_extension.db:conference.speakers', 'config' => [ 'type' => 'select', 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'tx_myextension_speaker', 'MM' => 'tx_myextension_conference_speaker_mm', // Speakers in the default language, not their translations 'foreign_table_where' => 'AND {#tx_myextension_speaker}.{#sys_language_uid} IN (-1, 0) ORDER BY tx_myextension_speaker.name', 'size' => 5, 'autoSizeMax' => 20, 'fieldControl' => [ 'editPopup' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.edit', ], ], 'addRecord' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.add', // A new speaker comes first in the list of selected speakers 'setValue' => 'prepend', ], ], 'listModule' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.list', ], ], ], ], ], ]); ExtensionManagementUtility::addToAllTCAtypes( 'tx_myextension_conference', 'speakers', '', 'before:--div--;my_extension.db:tab.details', );-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
- Scope
- Display
The edit popup field control shows a pencil icon to edit an element directly in a popup window.
When a record is selected and the edit button is clicked, that record opens in a new window for modification.
Note
The edit popup control is pre-configured, but disabled by default.
-
- Type
- boolean
- Default
- true
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['disabled']
- Scope
- Display
Disables the field control. Needs to be set to
falseto enable the Create new button
-
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']
-
- Type
- string
- Default
LLL:core. core: labels. edit - TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']['title']
- Values
- plain text label or label reference
Allows to set a different 'title' attribute to the popup icon.
-
- Type
- string
- Default
- height=800,width=600,status=0,menubar=0,scrollbars=1
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']['windowOpenParameters']
- Values
- plain text label or label reference
Allows to set a different size of the popup, defaults
Example: Multiple side-by-side select with edit popup
The speakers of a conference with field controls
EXT:my_extension/Configuration/TCA/Overrides/125-tx_myextension_conference-speakers.php<?php use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [ 'speakers' => [ 'label' => 'my_extension.db:conference.speakers', 'config' => [ 'type' => 'select', 'renderType' => 'selectMultipleSideBySide', 'foreign_table' => 'tx_myextension_speaker', 'MM' => 'tx_myextension_conference_speaker_mm', // Speakers in the default language, not their translations 'foreign_table_where' => 'AND {#tx_myextension_speaker}.{#sys_language_uid} IN (-1, 0) ORDER BY tx_myextension_speaker.name', 'size' => 5, 'autoSizeMax' => 20, 'fieldControl' => [ 'editPopup' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.edit', ], ], 'addRecord' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.add', // A new speaker comes first in the list of selected speakers 'setValue' => 'prepend', ], ], 'listModule' => [ 'disabled' => false, 'options' => [ 'title' => 'my_extension.db:conference.speakers.list', ], ], ], ], ], ]); ExtensionManagementUtility::addToAllTCAtypes( 'tx_myextension_conference', 'speakers', '', 'before:--div--;my_extension.db:tab.details', );-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['resetSelection']
- Scope
- Display
- Types
- Description
Render a button next to the select box to reset a changed selection to the state before it was manipulated by the user.
-
For details see fieldInformation.
-
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['defaultLanguageDifferences']
For details see defaultLanguageDifferences.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['localizationStateSelector']
For details see localizationStateSelector.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['otherLanguageContent']
For details see otherLanguageContent.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['selectIcons']
- Scope
- Display
Render thumbnails of icons below the select drop-down. Disabled by default.
-
-
- Type
- string
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fileFolderConfig']['allowedExtensions']
- Scope
- Display / Proc.
List of file extensions to select. If blank, all files are selected. Specify list in lowercase.
This configuration can be overridden by Page TSconfig.
-
- Type
- integer
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fileFolderConfig']['depth']
- Scope
- Display / Proc.
- RenderType
- all
Depth of directory recursions. Default is 99. Specify in range from 0-99. 0 (zero) means no recursion into subdirectories. Only useful in combination with property folder.
This configuration can be overridden by Page TSconfig.
-
- Type
- string
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fileFolderConfig']['folder']
- Scope
- Display / Proc.
Specifying a folder from where files are added to the item array.
Specify the folder relative to the
\TYPO3\. See getPublicPath() . Alternatively use the prefix "EXT:" to point to an extension folder.CMS\ Core\ Core\ Environment:: get Public Path () Files from the folder are selected recursively to the level specified by depth and only files of the extensions defined by allowedExtensions are listed in the select box.
Only the file reference relative to the folder is stored.
If the files are images (gif,png,jpg) they will be configured as icons (third parameter in items array).
This configuration can be overridden by Page TSconfig.
-
- Type
- string (table name)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table']
- Scope
- Display / Proc.
The item-array will be filled with records from the table defined here. The table must have a TCA definition.
The uids of the chosen records will be saved in a comma separated list by default.
Use property MM to store the values in an intermediate MM table instead.
-
- Type
- plain text label or label reference
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table_prefix']
- Scope
- Display
- RenderType
- all
Label prefix to the title of the records from the foreign-table.
-
- Type
- string (SQL WHERE)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_table_where']
- Scope
- Display / Proc.
- RenderType
- all
The items from foreign_table are selected with this
WHEREclause. TheWHEREclause is effectively appended to the existingWHEREclause (which contains default constraints, such asNOT deleted) and must begin withAND.See also foreign_table.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['items']
- Scope
- Display / Proc.
- RenderType
- all
Contains the elements for the selector box unless the property
foreign_ortable specialhas been set in which case automated values are set in addition to any values listed in this array.Each element in this array is in itself an associative array.
- label (plain text label or label reference)
- The displayed title.
- value (integer or string)
-
The value stored in the database.
- Values must not contain
,(comma) and|(vertical bar). If you want to useauth, you shouldMode - also refrain from using
:(colon).
- Values must not contain
- icon (EXT: path or icon identifier)
- Optional icon. For custom icons use a path prepended with
EXT:to refer to an image file found inside an extension or use an registered icon identifier. If configured on theforeign_, selicon-field is respected.table - description (string or array)
- Fifth value is an optional description text. This is only shown when the list is shown
with
render.Type='select Check Box'
Note
When having a zero as
valueand the field is of typeintin the database, make sure to define the default value as well in TCA:(10) 'default' => 0. Otherwise issues may arise, e.g. with MySQL strict mode.For example see Side-by-side view with filter.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['itemsProcessors']
- Scope
- Display / Proc.
- Added
- 14.0
An array indexed numerically. Each entry defines an item processor implementing
Items.Processor Interface Item processors are executed sequentially based on their numerical array key. Each processor can add, modify, or remove items from the
Select, influencing which items are ultimately displayed.Item Collection This option can be combined with itemsProcFunc. If both are configured,
itemsis executed first andProc Func itemsare executed afterwards.Processors EXT:my_extension/Configuration/TCA/Overrides/121-tx_myextension_conference-timezone.php<?php use MyVendor\MyExtension\Backend\ItemsProcessor\TimezoneItemsProcessor; use MyVendor\MyExtension\Backend\TimezoneSorter; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [ 'timezone' => [ 'label' => 'my_extension.db:conference.timezone', 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ ['label' => '', 'value' => ''], ], 'itemsProcessors' => [ 100 => [ 'class' => TimezoneItemsProcessor::class, 'parameters' => [ 'regions' => 'Europe,America', ], ], ], 'itemGroups' => [ 'Europe' => 'my_extension.db:conference.timezone.europe', 'America' => 'my_extension.db:conference.timezone.america', ], 'sortItems' => [ 'label' => 'asc', // Then by the offset to UTC, the time zones with the same offset // stay sorted by label 'offset' => TimezoneSorter::class . '->sortByOffset', ], 'dbFieldLength' => 64, 'behaviour' => [ 'allowLanguageSynchronization' => true, ], ], ], ]); ExtensionManagementUtility::addToAllTCAtypes( 'tx_myextension_conference', 'timezone', '', 'after:location', );For fields of type
select, eachSelectmust be created withItem type: 'select'and must provide alabeland avalue. The value can be an integer or a string. Use the special value'--to insert a divider (that cannot be selected).div--' You can also use any arguments supported by the items array, including
groupto group items. Rendering theiconordescriptionis not supported.EXT:my_extension/Classes/Backend/ItemsProcessor/TimezoneItemsProcessor.php<?php declare(strict_types=1); namespace MyVendor\MyExtension\Backend\ItemsProcessor; use TYPO3\CMS\Core\DataHandling\ItemsProcessorContext; use TYPO3\CMS\Core\DataHandling\ItemsProcessorInterface; use TYPO3\CMS\Core\Schema\Struct\SelectItem; use TYPO3\CMS\Core\Schema\Struct\SelectItemCollection; /** * Offers the time zones of the regions given in the parameter "regions", * grouped by region */ final readonly class TimezoneItemsProcessor implements ItemsProcessorInterface { public function processItems( SelectItemCollection $items, ItemsProcessorContext $context, ): SelectItemCollection { $regions = explode(',', (string)($context->processorParameters['regions'] ?? 'Europe')); foreach (\DateTimeZone::listIdentifiers() as $identifier) { [$region, $city] = array_pad(explode('/', $identifier, 2), 2, ''); if ($city === '' || !in_array($region, $regions, true)) { continue; } $items->add(new SelectItem( type: 'select', label: str_replace('_', ' ', $city), value: $identifier, group: $region, )); } return $items; } }
-
- Type
- string (class->method reference)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['itemsProcFunc']
- Scope
- Display / Proc.
PHP method which is called to fill or manipulate the items array. See itemsProcFunc about details.
-
- Type
- integer > 0
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['maxitems']
- Scope
- Display / Proc.
Maximum number of child items. Defaults to a high value. JavaScript record validation prevents the record from being saved if the limit is not satisfied.
-
- Type
- integer > 0
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['minitems']
- Scope
- Display
Minimum number of child items. Defaults to 0. JavaScript record validation prevents the record from being saved if the limit is not satisfied.
Note
TCA table column fields that define ['config'] can omit the
specification of the intermediate MM table layout in
ext_tables.sql. The TYPO3 database
analyzer takes care of proper schema definition.
-
- Type
- string (table name)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['MM']
- Scope
- Proc.
This value contains the name of the table in which to store a MM relation. It is used together with foreign_table.
The database field with a MM property only stores the number of records in the relation.
Please have a look into the additional information in the MM common property description.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['MM_match_fields']
- Scope
- Display / Proc.
Array of field => value pairs to both insert and match against when writing/reading MM relations.
-
- Type
- string (field name)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['MM_opposite_field']
- Scope
- Proc.
If you want to make a MM relation editable from the foreign side (bidirectional) of the relation as well, you need to set
MM_on the foreign side to the field name on the local side.opposite_ field For example, if the field
companies.is your local side and you want to make the same relation editable from the foreign side of the relation in a field calledemployees persons., you would need to set theemployers MM_value of the TCA configuration of theopposite_ field persons.field to the string "employees".employers Note
Bidirectional references only get registered once on the native side in
sys_.refindex
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['MM_oppositeUsage']
- Scope
- Proc.
In a MM bidirectional relation using match fields the opposite side needs to know about the match fields for certain operations (for example, when a copy is created in a workspace) so that relations are carried over with the correct information.
MM_is an array which references which fields contain the references to the opposite side, so that they can be queried for match field configuration.opposite Usage
-
- Type
- string (SQL WHERE)
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['MM_table_where']
- Scope
- Proc.
Additional where clause used when reading MM relations.
Example:
{#uid_local} = ###THIS_UID###Copied!The above example uses the special field quoting syntax
{#...}around identifiers to be as DBAL-compatible as possible.
-
- Type
- boolean
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['multiple']
- Scope
- Display / Proc.
Allows the same item more than once in a list.
If used with bidirectional MM relations it must be set for both the native and foreign field configuration.
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['multiSelectFilterItems']
- Scope
- Display
Contains predefined elements for the filter field. On selecting an item, the list of available items gets automatically filtered.
Each element in this array is in itself an array where:
- First value is the filter value of the item .
- Second value is the item label (plain text label or label reference)
The equipment of a talk with its filter
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
'equipment' => [
'label' => 'my_extension.db:talk.equipment',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'items' => [
['label' => 'my_extension.db:talk.equipment.audio', 'value' => '--div--'],
['label' => 'my_extension.db:talk.equipment.handheld_microphone', 'value' => 'handheld_microphone'],
['label' => 'my_extension.db:talk.equipment.headset', 'value' => 'headset'],
['label' => 'my_extension.db:talk.equipment.video', 'value' => '--div--'],
['label' => 'my_extension.db:talk.equipment.projector', 'value' => 'projector'],
['label' => 'my_extension.db:talk.equipment.video_recording', 'value' => 'video_recording'],
],
'size' => 5,
'autoSizeMax' => 10,
'multiple' => true,
'multiSelectFilterItems' => [
['label' => '', 'value' => ''],
['label' => 'my_extension.db:talk.equipment.microphone', 'value' => 'microphone'],
['label' => 'my_extension.db:talk.equipment.video', 'value' => 'video'],
],
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
],
]);
ExtensionManagementUtility::addToAllTCAtypes(
'tx_myextension_talk',
'equipment',
'talk,workshop',
'before:--div--;core.form.tabs:access',
);
-
- Type
- boolean
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['readOnly']
- Scope
- Display
Renders the field in a way that the user can see the value but cannot edit it.
Warning
This property affects only the display. It is still possible to write to those fields when using the DataHandler.
-
- Type
- string
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['relationship']
- Scope
- Proc.
New in version 13.3
Defines whether the field holds one related record or several, if it relates to records through
foreign_. This decides which value a Record object provides for this field, for example in a Fluid template.table one,To One manyTo One - The field provides a single
Recordobject, ornullif no record is selected.maxitemsis set to1automatically, overriding any other value. oneTo Many - The field provides a
LazyofRecord Collection Recordobjects.
A field with
MMalways provides a collection, whateverrelationshipsays. Any other value, includingmany, throws an exception unlessTo Many MMis set.maxitemsdoes not change the result the other way round: a field withonestill provides a collection, even ifTo Many maxitemsis1.A select field without
foreign_has no relation. It provides an array of the selected values, or the single value fortable render.Type => 'select Single' If
relationshipis not set, a field withforeign_provides a collection.table
-
- Type
- boolean
- Default
- false
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
- Scope
- Display
Changed in version 14.2
Starting with TYPO3 14.2, relational fields are hidden when no selectable items are available. Option
showwill disable this behaviour.If Empty By default,
selectfields and any render types are hidden when no select items are available. Settingshowto true displays the field even if no options are available.If Empty EXT:my_extension/Configuration/TCA/Overrides/pages.php$GLOBALS['TCA']['pages']['columns']['some_select_field']['config']['showIfEmpty'] = true;Copied!Possible reasons why no select items are available:
- a foreign_table is used and the referenced table has no records or none matching the foreign_table_where.
- a foreign_table is used and the currently logged in user has no permissions for the referenced table or all of it records.
- All items have been hidden via page TSconfig, for example, removeItems or keepItems are inproperly configured.
- The itemsProcessors or itemsProcFunc had no result.
-
- Type
- integer
- Default
- 1
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['size']
- Scope
- Display
If set to 1 (default), displays a select drop-down, else a select box of given size.