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'. While exclude 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:

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_single_13' => [
            'label' => 'select_single_13 l10n_display=defaultAsReadonly',
            'l10n_mode' => 'exclude',
            'l10n_display' => 'defaultAsReadonly',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => [
                    [
                        'label' => 'foo',
                        'value' => 'foo',
                    ],
                    [
                        'label' => 'bar',
                        'value' => 'bar',
                    ],
                ],
            ],
        ],
    ],
]
Copied!

Translated field without l10n_display definition

The following has no 'l10n_display' definition:

Complete TCA definition of the field:

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    'columns' => [
        'select_single_8' => [
            'label' => 'select_single_8 drop down with empty div',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => [
                    [
                        'label' => 'First div with items',
                        'value' => '--div--',
                    ],
                    [
                        'label' => 'item 1',
                        'value' => 1,
                    ],
                    [
                        'label' => 'item 2',
                        'value' => 2,
                    ],
                    [
                        'label' => 'Second div without items',
                        'value' => '--div--',
                    ],
                    [
                        'label' => 'Third div with items',
                        'value' => '--div--',
                    ],
                    [
                        'label' => 'item 3',
                        'value' => 3,
                    ],
                ],
            ],
        ],
    ],
]
Copied!