selectMultipleSideBySide

This page describes the select type with 'renderType' => 'selectMultipleSideBySide'.

It displays two select fields. The items can be selected from the right field. All selected items are displayed in the left field.

Example: Basic side-by-side select field

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_multiplesidebyside_1' => [
            'label' => 'select_multiplesidebyside_1 autoSizeMax=10, size=3 description',
            'description' => 'field description',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'items' => [
                    [
                        'label' => 'foo 1',
                        'value' => 1,
                    ],
                    [
                        'label' => 'foo 2',
                        'value' => 2,
                    ],
                    [
                        'label' => 'a divider',
                        'value' => '--div--',
                    ],
                    [
                        'label' => 'foo 3',
                        'value' => 3,
                    ],
                    [
                        'label' => 'foo 4',
                        'value' => 4,
                    ],
                    [
                        'label' => 'foo 5',
                        'value' => 5,
                    ],
                    [
                        'label' => 'foo 6',
                        'value' => 6,
                    ],
                ],
                'size' => 3,
                'autoSizeMax' => 10,
                'multiple' => true,
            ],
        ],
    ],
]
Copied!

For more examples see also Advanced examples for multiple side-by-side select boxes.

Properties of the TCA column type select with renderType selectMultipleSideBySide

Name Type Scope
boolean Proc.
string (keyword) Display / Proc.
integer Display
boolean Proc.
string Display / Proc.
boolean Display
string (list of) Display / Proc.
array
array
array
array fieldWizard
string Display / Proc.
integer Display / Proc.
string Display / Proc.
string (table name) Proc. / Display
string or LLL reference Display
string (SQL WHERE) Proc. / Display
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 Proc.
array Display
boolean Display / Proc.
boolean Display
integer Display

allowNonIdValues

allowNonIdValues
Type
boolean
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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 just enter additional items in the items array to produce some string-value elements for the list.

authMode

authMode
Type
string (keyword)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display / Proc.
RenderType
all

Changed in version 12.0

The only valid value for TCA config option authMode is now explicitAllow. The values explicitDeny and individual are obsolete and no longer evaluated.

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!)
Migration: Using authMode='explicitDeny'

The "deny list" approach for single field values has been removed, the only allowed option for authMode is explicitAllow. Extensions using config value explicitDeny should be adapted to switch to explicitAllow instead. The upgrade wizard "Migrate backend groups "explicit_allowdeny" field to simplified format." that transfers existing be_groups rows to the new format, drops any DENY fields and instructs admins to not set new access rights of affected backend groups.

Migration: Using authMode='individual'

Handling of authMode being set to individual has been fully dropped. The Core provides no alternative. This has been an obscure setting ever since and there is no direct migration. Extensions that rely on this handling need to find a substitution based on Core hooks, Core events or other existing Core API functionality.

Changed in version 12.0

Handling of TCA config option authMode_enforce has been removed.

Migration: Using authMode_enforce='strict'

Extensions with select fields using authMode previously had different handling if authMode_enforce => 'strict' has been set: Let us say an editor accesses a record with an authMode field being set to a value it has no access to. With authMode_enforce not being set to strict, the editor was still able to edit the record and set the value to something it had access to. With authMode_enforce being set to strict, the editor was not allowed to access the record. This has been streamlined: The backend interface no longer renders those records for the editor and an "access denied" message is rendered instead. To prevent this, a group this editor is member of needs to be adapted to allow access to this particular value in the "Explicitly allow field values" (explicit_allowdeny) field.

autoSizeMax

autoSizeMax
Type
integer
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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 autoSizeMax.

behaviour

behaviour

allowLanguageSynchronization

allowLanguageSynchronization
Type
boolean
Default
false
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_state. It tells the DataHandler which fields of the localization records should be kept in sync if the underlying default or source record changes.

EXT:my_extension/Configuration/TCA/Overrides/someTable.php
<?php

$selectField = [
    'config' => [
        'type' => 'select',
        'renderType' => 'selectMultipleSideBySide',
        'behaviour' => [
            'allowLanguageSynchronization' => true,
        ],
    ],
];
Copied!

default

default
Type
string
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

disableNoMatchingValueElement

disableNoMatchingValueElement
Type
boolean
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

exclusiveKeys

exclusiveKeys
Type
string (list of)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display / Proc.

List of keys that exclude any other keys in a select box where multiple items could be selected.

fieldControl

fieldControl

addRecord

addRecord
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
Scope
fieldControl
Types
group

Control button to directly add a related record. Leaves the current view and opens a new form to add a new record. On 'Save and close', the record is directly selected.

disabled

disabled
Type
boolean
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']
Scope
fieldControl -> addRecord
Default
true

Disables the field control. Needs to be set to false to enable the Create new button

options

options
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']

pid

pid
Type
string
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']['pid']
Scope
fieldControl -> addRecord
Values
marker or an integer
Default
###CURRENT_PID###

pid of the new record. Can be an hard pid setting, or one of these markers, see select foreign_table_where.

Falls back to "current pid" if not set, forces pid=0 if records of this table are only allowed on root level.

  • ###CURRENT_PID###
  • ###THIS_UID###
  • ###SITEROOT###

title

title
Type
string
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']['title']
Values
string or LLL reference
Default
LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.createNew

Allows to set a different 'title' attribute to the popup icon.

setValue

setValue
Type
string
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['addRecord']['options']['setValue']
Values
string
Default
append

Can be one of 'set', 'prepend' or 'append'. With 'set' the given selection is substituted with the new record, 'prepend' adds the new record on top of the list, 'append' adds it at the bottom.

Example: Multiple sidebyside select field with "Add record" enabled
EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_multiplesidebyside_1' => [
            'label' => 'select_multiplesidebyside_1 autoSizeMax=10, size=3 description',
            'description' => 'field description',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'items' => [
                    [
                        'label' => 'foo 1',
                        'value' => 1,
                    ],
                    [
                        'label' => 'foo 2',
                        'value' => 2,
                    ],
                    [
                        'label' => 'a divider',
                        'value' => '--div--',
                    ],
                    [
                        'label' => 'foo 3',
                        'value' => 3,
                    ],
                    [
                        'label' => 'foo 4',
                        'value' => 4,
                    ],
                    [
                        'label' => 'foo 5',
                        'value' => 5,
                    ],
                    [
                        'label' => 'foo 6',
                        'value' => 6,
                    ],
                ],
                'size' => 3,
                'autoSizeMax' => 10,
                'multiple' => true,
            ],
        ],
    ],
]
Copied!
Example: Select field with options

The field controls are also used in the core. The following example is from the table be_groups:

EXT:core/Configuration/TCA/be_groups.php
[
    'columns' => [
        'file_mountpoints' => [
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'sys_filemounts',
                'foreign_table_where' => ' AND {#sys_filemounts}.{#pid}=0',
                'size' => 3,
                'autoSizeMax' => 10,
                'fieldControl' => [
                    'editPopup' => [
                        'disabled' => false,
                        'options' => [
                            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints_edit_title',
                        ],
                    ],
                    'addRecord' => [
                        'disabled' => false,
                        'options' => [
                            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints_add_title',
                            'setValue' => 'prepend',
                        ],
                    ],
                    'listModule' => [
                        'disabled' => false,
                        'options' => [
                            'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:file_mountpoints_list_title',
                        ],
                    ],
                ],
            ],
        ],
    ],
]
Copied!

editPopup

editPopup
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
Scope
fieldControl

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.

disabled

disabled
Type
boolean
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']
Scope
fieldControl -> editPopup
Default
true

Disables the field control. Needs to be set to false to enable the Create new button

options

options
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']

title

title
Type
string
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']['title']
Values
string or LLL reference
Default
LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.edit

Allows to set a different 'title' attribute to the popup icon.

windowOpenParameters

windowOpenParameters
Type
string
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']['windowOpenParameters']
Values
string or LLL reference
Default
height=800,width=600,status=0,menubar=0,scrollbars=1

Allows to set a different size of the popup, defaults

Example: Multiple side-by-side select with edit popup
EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_multiplesidebyside_6' => [
            'label' => 'select_multiplesidebyside_6 fieldControl',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'tx_styleguide_staticdata',
                'size' => 5,
                'autoSizeMax' => 20,
                'fieldControl' => [
                    'editPopup' => [
                        'disabled' => false,
                        'options' => [
                            'windowOpenParameters' => 'height=300,width=500,status=0,menubar=0,scrollbars=1',
                        ],
                    ],
                    'addRecord' => [
                        'disabled' => false,
                    ],
                    'listModule' => [
                        'disabled' => false,
                    ],
                ],
            ],
        ],
    ],
]
Copied!

resetSelection

resetSelection
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['resetSelection']
Scope
fieldControl
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.

fieldInformation

fieldInformation

For details see fieldInformation.

fieldWizard

fieldWizard

defaultLanguageDifferences

defaultLanguageDifferences
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['defaultLanguageDifferences']

For details see defaultLanguageDifferences.

localizationStateSelector

localizationStateSelector
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['localizationStateSelector']

For details see localizationStateSelector.

otherLanguageContent

otherLanguageContent
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['otherLanguageContent']

For details see otherLanguageContent.

selectIcons

selectIcons
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['selectIcons']
Scope
fieldWizard

Render thumbnails of icons below the select drop-down. Disabled by default.

fileFolderConfig

fileFolderConfig

allowedExtensions

allowedExtensions
Type
string
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.

depth

depth
Type
integer
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.

folder

folder
Type
string
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\CMS\Core\Core\Environment::getPublicPath(). See getPublicPath() . Alternatively use the prefix "EXT:" to point to an extension folder.

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.

foreign_table

foreign_table
Type
string (table name)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Proc. / Display

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 <columns-select-byside-properties-mm> to store the values in an intermediate MM table instead.

Deprecated since version 11.2

Usage of the foreign_table relation with the table sys_language Has been deprecated. Use TCA field type called language instead.

foreign_table_prefix

foreign_table_prefix
Type
string or LLL reference
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display
RenderType
all

Label prefix to the title of the records from the foreign-table.

foreign_table_where

foreign_table_where
Type
string (SQL WHERE)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Proc. / Display
RenderType
all

The items from foreign_table are selected with this WHERE clause. The WHERE clause is effectively appended to the existing WHERE clause (which contains default constraints, such as NOT deleted) and must begin with AND.

See also foreign_table.

items

items
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display / Proc.
RenderType
all

Contains the elements for the selector box unless the property foreign_table or special has been set in which case automated values are set in addition to any values listed in this array.

Items registered for the field CType of table tt_content get automatically added to the New content element wizard. Settings from the items property can be overridden via page TSconfig newContentElement.wizardItems.

See also Add content elements to the Content Element Wizard.

Deprecated since version 12.3

Using the numerical indexes 0 - 4 is deprecated. Use the newly introduced keys.

Each element in this array is in itself an associative array.

label (string or LLL 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 use authMode, you should
    also refrain from using : (colon).
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 the foreign_table, selicon-field is respected.
description (string or array)
Fifth value is an optional description text. This is only shown when the list is shown with renderType='selectCheckBox'.

For example see Side-by-side view with filter.

itemsProcFunc

itemsProcFunc
Type
string (class->method reference)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display / Proc.

PHP method which is called to fill or manipulate the items array. See itemsProcFunc about details.

maxitems

maxitems
Type
integer > 0
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

minitems

minitems
Type
integer > 0
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

New in version 11.4

TCA table column fields that define ['config']['MM'] can omit the specification of the intermediate MM table layout in ext_tables.sql. The TYPO3 database analyzer takes care of proper schema definition.

Extensions are strongly encouraged to drop CREATE TABLE definitions from the ext_tables.sql file for those intermediate tables referenced by TCA table columns. Dropping these definitions allows the Core to adapt and migrate definitions if needed.

MM

MM
Type
string (table name)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

MM_match_fields

MM_match_fields
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display / Proc.

Array of field => value pairs to both insert and match against when writing/reading MM relations.

MM_opposite_field

MM_opposite_field
Type
string (field name)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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_opposite_field on the foreign side to the field name on the local side.

For example, if the field companies.employees is your local side and you want to make the same relation editable from the foreign side of the relation in a field called persons.employers, you would need to set the MM_opposite_field value of the TCA configuration of the persons.employers field to the string "employees".

MM_oppositeUsage

MM_oppositeUsage
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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_oppositeUsage is an array which references which fields contain the references to the opposite side, so that they can be queried for match field configuration.

MM_table_where

MM_table_where
Type
string (SQL WHERE)
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

MM_hasUidField

MM_hasUidField
Type
boolean
Scope
Proc.

If the "multiple" feature is used with MM relations you must set this value to true and include a UID field. Otherwise sorting and removing relations will be buggy.

multiSelectFilterItems

multiSelectFilterItems
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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 (string or LLL reference)
Example: Select by predefined keywords
EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_multiplesidebyside_5' => [
            'label' => 'select_multiplesidebyside_5 multiSelectFilterItems',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'items' => [
                    [
                        'label' => 'foo 1',
                        'value' => 1,
                    ],
                    [
                        'label' => 'foo 2',
                        'value' => 2,
                    ],
                    [
                        'label' => 'foo 3',
                        'value' => 3,
                    ],
                    [
                        'label' => 'bar',
                        'value' => 4,
                    ],
                ],
                'multiSelectFilterItems' => [
                    [
                        '',
                        '',
                    ],
                    [
                        'foo',
                        'foo',
                    ],
                    [
                        'bar',
                        'bar',
                    ],
                ],
            ],
        ],
    ],
]
Copied!

multiple

multiple
Type
boolean
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
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.

The property MM_hasUidField has to be defined when using multiple.

readOnly

readOnly
Type
boolean
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.

size

size
Type
integer
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display
Default
1

If set to 1 (default), displays a select drop-down, else a select box of given size.