Folder

New in version 12.0

A new TCA type folder has been introduced, which replaces the old combination of 'type' => 'group' and 'internal_type' => 'folder'.

New in version 13.0

The TCA type folder creates a field where folders can be attached to the record. The values are stored as a combined identifier in a comma-separated list (csv).

Examples

'columns' => [
    'aColumn' => [
        'config' => [
            'type' => 'folder',
        ],
    ],
],
Copied!

Properties of the TCA column type folder

Name Type Scope
boolean Proc.
integer Display
array Display
array fieldControl
array
array
array
boolean Display
integer > 0 Display / Proc.
integer > 0 Display
boolean Display / Proc.
boolean Display
integer Display
behaviour
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

$folderField = [
    'config' => [
        'type' => 'folder',
        'behaviour' => [
            'allowLanguageSynchronization' => true,
        ],
    ],
];
Copied!
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.

elementBrowserEntryPoints
Type
array
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display

By default, the last folder is used when opening the element browser. Setting this configuration value changes this behaviour.

This configuration value contains an array. For the column type folder only the value with the key _default is used.

When opening the element browser the folder with the _default key is preselected.

Example: Open the element type on a specific folder

You can also define an entry point with the _default key:

'folder_group' => [
    'label' => 'Folder field',
    'config' => [
        'type' => 'folder',
        'elementBrowserEntryPoints' => [
            '_default' => '1:/styleguide/'
        ]
    ]
],
Copied!

It is also possible to use a special TSconfig key:

'folder_group' => [
    'label' => 'Folder field',
    'config' => [
        'type' => 'folder',
        'elementBrowserEntryPoints' => [
            '_default' => '###PAGE_TSCONFIG_ID###'
        ]
    ]
],
Copied!

This key has then to be defined on field level:

TCEFORM.my_table.folder_group.PAGE_TSCONFIG_ID = 1:/styleguide/subfolder
Copied!

In case an allowed table has no entry point defined, the _default is used. In case _default is also not set or elementBrowserEntryPoints is not used at all, the previous behaviour applies.

fieldControl

The field of type folder can enable all common field control options. Furthermore the following are available:

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

The element browser field control used in type='folder' renders a button to open an element browser to choose a folder.

It is enabled by default if rendering a folder element.

fieldInformation

For details see fieldInformation.

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

For details see defaultLanguageDifferences.

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

For details see localizationStateSelector.

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

For details see otherLanguageContent.

hideMoveIcons
Type
boolean
Path
$GLOBALS['TCA'][$table]['columns'][$field]['config']
Scope
Display

Removes the move icons next to the selector box.

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
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.

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

Allows the same item more than once in a list.

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

The minimum 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.