mode¶
-
mode
¶ -
- Type
- string (keywords)
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Scope
- Display
- Types
- input
Possible keywords:
useOrOverridePlaceholder
This property is related to the
placeholder
property. When defined, a checkbox will appear above the field. If that box is checked, the field can be used to enter whatever the user wants as usual. If the box is not checked, the field becomes read-only and the value saved to the database will beNULL
.For example, this is used for the
sys_file_metadata
TCA configuration used for file references, so that fields liketitle
will fall back to the default title of a file instead of using an empty value defined for the reference.Warning
In order for this property to apply properly, option nullable must be set to
true
.
Examples¶
An input field with placeholder that can be overridden¶
![](../../Images/AutomaticScreenshots/Input28.png)
EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
'columns' => [
'input_28' => [
'label' => 'input_28',
'description' => 'placeholder=__row|input_26 mode=useOrOverridePlaceholder nullable=true default=null',
'config' => [
'type' => 'input',
'placeholder' => '__row|input_26',
'nullable' => true,
'default' => null,
'mode' => 'useOrOverridePlaceholder',
],
],
],
]
Copied!
A text field with placeholder that can be overridden¶
![](../../Images/AutomaticScreenshots/Text14.png)
EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
'columns' => [
'text_14' => [
'label' => 'text_14',
'description' => 'placeholder=__row|text_12, mode=useOrOverridePlaceholder, nullable=true',
'config' => [
'type' => 'text',
'placeholder' => '__row|text_12',
'nullable' => true,
'mode' => 'useOrOverridePlaceholder',
],
],
],
]
Copied!