Localization display (l10n_display)¶
-
l10n_display
¶ -
- Type
- string (list of keywords)
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]
- Required
- false
- Scope
- Display
Localization display, see l10n_mode.
This option can be used to define the language related field rendering. This has nothing to do with the processing of language overlays and data storage but the display of form fields.
Keywords are:
- hideDiff
- The differences to the default language field will not be displayed.
- defaultAsReadonly
- This renders the field as read only field with the content of the default
language record. The field will be rendered even if
l10n_mode is set to
'exclude'
. Whileexclude
defines the field not to be translatable, this option activates the display of the default data.
Examples¶
Select field with defaultAsReadonly
¶
The following field has the option 'l10n_display' => 'defaultAsReadonly'
set:
Complete TCA definition of the field:
[
'columns' => [
'select_single_13' => [
'exclude' => 1,
'label' => 'select_single_13 l10n_display=defaultAsReadonly',
'l10n_mode' => 'exclude',
'l10n_display' => 'defaultAsReadonly',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
'foo',
'foo',
],
[
'bar',
'bar',
],
],
],
],
],
]
Copied!
Translated field without l10n_display
definition¶
The following has no 'l10n_display'
definition:
Complete TCA definition of the field:
[
'columns' => [
'select_single_8' => [
'exclude' => 1,
'label' => 'select_single_8 drop down with empty div',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
'First div with items',
'--div--',
],
[
'item 1',
1,
],
[
'item 2',
2,
],
[
'Second div without items',
'--div--',
],
[
'Third div with items',
'--div--',
],
[
'item 3',
3,
],
],
],
],
],
]
Copied!