Folder¶
New in version 12.0
A new TCA type folder
has been introduced, which replaces the old
combination of 'type' => 'group'
and 'internal_
.
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).
Table of contents
Examples¶
'columns' => [
'aColumn' => [
'config' => [
'type' => 'folder',
],
],
],
Properties of the TCA column type folder
¶
-
behaviour
¶ -
-
allow
¶Language Synchronization -
- 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_
. It tells the DataHandler which fields of the localization records should be kept in sync if the underlying default or source record changes.state
-
-
auto
¶Size Max -
- 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
auto
.Size Max Note
Only has an effect if maxitems is greater than 1.
-
element
¶Browser Entry Points -
- 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.
You can also define an entry point with the _default
key:
'folder_group' => [
'label' => 'Folder field',
'config' => [
'type' => 'folder',
'elementBrowserEntryPoints' => [
'_default' => '1:/styleguide/'
]
]
],
It is also possible to use a special TSconfig key:
'folder_group' => [
'label' => 'Folder field',
'config' => [
'type' => 'folder',
'elementBrowserEntryPoints' => [
'_default' => '###PAGE_TSCONFIG_ID###'
]
]
],
This key has then to be defined on field level:
TCEFORM.my_table.folder_group.PAGE_TSCONFIG_ID = 1:/styleguide/subfolder
In case an allowed table has no entry point defined, the _default
is used.
In case _default
is also not set or element
is not
used at all, the previous behaviour applies.
-
field
¶Control -
The field of type folder can enable all common field control options. Furthermore the following are available:
-
element
¶Browser -
- 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.
-
-
field
¶Information -
For details see fieldInformation.
-
field
¶Wizard -
-
default
¶Language Differences -
- Type
- array
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['defaultLanguageDifferences']
For details see defaultLanguageDifferences.
-
localization
¶State Selector -
- Type
- array
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['localizationStateSelector']
For details see localizationStateSelector.
-
other
¶Language Content -
- Type
- array
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['otherLanguageContent']
For details see otherLanguageContent.
-
-
hide
¶Delete Icon -
- Type
- boolean
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Scope
- Display
Removes the delete icon next to the selector box.
-
hide
¶Move Icons -
- 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.
-
read
¶Only -
- 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.
Warning
This property affects only the display. It is still possible to write to those fields when using the DataHandler.
-
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.