Localization display (l10n_display)

l10n_display
Path

$GLOBALS['TCA'][$table]['columns'][$field]

Required

false

Type

string (list of keywords)

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:

../../_images/TranslatedSelectSingle13.png

Complete TCA definition of the field:

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    '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',
                    ],
                ],
            ],
        ],
    ],
]

Translated field without l10n_display definition

The following has no 'l10n_display' definition:

../../_images/TranslatedSelectSingle8.png

Complete TCA definition of the field:

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php
[
    '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,
                    ],
                ],
            ],
        ],
    ],
]