languageField

languageField
Path

$GLOBALS['TCA'][$table]['ctrl']

type

string (field name of type language)

Scope

Proc. / Display

Deprecated since version 11.2

This property contains the field name of the field which contains a pointer to the language of the record. The field should have the type language. The field is called sys_language_uid by convention.

This TCA type automatically displays all available languages for the current context (the corresponding site configuration) and also automatically adds the special -1 language (meaning all languages) for all record types, except pages.

Backend users can be limited to have edit access for only certain of these languages and if this option is set, edit access for languages will be enforced for this table.

Also see the Frontend Localization Guide for a discussion about the effects of this property (and other TCA properties) on the localization process.

Example

A typical sys_language_uid field
EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php
<?php

return [
    'ctrl' => [
        'transOrigPointerField' => 'l18n_parent',
        'transOrigDiffSourceField' => 'l18n_diffsource',
        'languageField' => 'sys_language_uid',
        'translationSource' => 'l10n_source',
        // ...
    ],
    'columns' => [
        'sys_language_uid' => [
            'exclude' => true,
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
            'config' => [
                'type' => 'language',
            ],
        ],
        'l18n_parent' => [
            'displayCond' => 'FIELD:sys_language_uid:>:0',
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'items' => [
                    [
                        '',
                        0,
                    ],
                ],
                'foreign_table' => 'tx_myextension_domain_model_something',
                'foreign_table_where' =>
                    'AND {#tx_myextension_domain_model_something}.{#pid}=###CURRENT_PID###'
                    . ' AND {#tx_myextension_domain_model_something}.{#sys_language_uid} IN (-1,0)',
                'default' => 0,
            ],
        ],
        'l10n_source' => [
            'config' => [
                'type' => 'passthrough',
            ],
        ],
        'l18n_diffsource' => [
            'config' => [
                'type' => 'passthrough',
                'default' => '',
            ],
        ],
        // ...
    ],
];
Copied!