---
title: "Examples"
manual: "TCA Reference"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3tca:columns-example@14.3"
source: "Columns/Examples.rst"
rendered: "2026-10-01T16:42:39+00:00"
---

# Examples {#columns-example}

Some examples from extension styleguide to get an idea on what the
field definition is capable of: An input field
with slider, a select drop-down for images, an inline relation spanning multiple tables.

The following examples all can be found in the
[extension styleguide](https://docs.typo3.org/permalink/t3tca:styleguide@14.3).

## Select drop-down for records represented by images {#columns-example-drop-down}

![](../Images/AutomaticScreenshots/SelectSingle12.png)

Select field with foreign table relation and field wizard:

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php**

```php
[
    'columns' => [
        'select_single_12' => [
            'label' => 'select_single_12 foreign_table selicon_field',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectSingle',
                'foreign_table' => 'tx_styleguide_elements_select_single_12_foreign',
                'fieldWizard' => [
                    'selectIcons' => [
                        'disabled' => false,
                    ],
                ],
            ],
        ],
    ],
]
```

The table `tx_styleguide_elements_select_single_12_foreign` is defined as
follows:

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select_single_12_foreign.php**

```php
<?php

return [
  'ctrl' => [
    'title' => 'Form engine elements - select foreign single_12',
    'label' => 'fal_1',
    'iconfile' => 'EXT:styleguide/Resources/Public/Icons/tx_styleguide.svg',
    'tstamp' => 'tstamp',
    'crdate' => 'crdate',
    'delete' => 'deleted',
    'sortby' => 'sorting',
    'selicon_field' => 'fal_1',
    'languageField' => 'sys_language_uid',
    'transOrigPointerField' => 'l10n_parent',
    'transOrigDiffSourceField' => 'l10n_diffsource',
    'translationSource' => 'l10n_source',
    'enablecolumns' => [
      'disabled' => 'hidden',
    ],
    'security' => [
      'ignorePageTypeRestriction' => true,
    ],
  ],

  'columns' => [
    'fal_1' => [
      'label' => 'fal_1 selicon_field',
      'config' => [
        'type' => 'file',
        'allowed' => 'common-media-types',
        'relationship' => 'manyToOne',
      ],
    ],
  ],

  'types' => [
    '0' => [
      'showitem' => 'fal_1',
    ],
  ],

];

```

## Inline relation (IRRE) spanning multiple tables {#tca-example-inline-1n1n-inline-1}

![](../Images/AutomaticScreenshots/Inline1n1nInline1.png)

Inline relation to a foreign table:

**EXT:styleguide/Configuration/TCA/tx_styleguide_inline_1n1n.php**

```php
[
    'columns' => [
        'inline_1' => [
            'label' => 'inline_1',
            'config' => [
                'type' => 'inline',
                'foreign_table' => 'tx_styleguide_inline_1n1n_child',
                'foreign_field' => 'parentid',
                'foreign_table_field' => 'parenttable',
            ],
        ],
    ],
]
```

## Example: prefixLangTitle {#tca-example-translated-text-2}

The following example can be found in the [extension styleguide](https://docs.typo3.org/permalink/t3tca:styleguide@14.3). On translating a record in a new language the content of the
field gets copied to the target language. It get prefixed with
`[Translate to <language name>:]`.

![](../Images/AutomaticScreenshots/TranslatedText2.png)

The language mode is defined as follows:

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php**

```php
[
    'columns' => [
        'text_2' => [
            'l10n_mode' => 'prefixLangTitle',
            'label' => 'text_2',
            'description' => 'cols=20',
            'config' => [
                'type' => 'text',
                'cols' => 20,
            ],
        ],
    ],
]
```

## Disable the prefixLangTitle for the header field in tt_content {#tca-example-l10n-mode}

Use the default behaviour instead of `prefixLangTitle`: the field will
be copied without a prepended string.

**EXT:my_sitepackage/Configuration/TCA/Overrides/tt_content.php**

```php
$GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = '';
```

## Select field with `defaultAsReadonly` {#tca-example-translated-select-single-13}

The following field has the option `'l10n_display' => 'defaultAsReadonly'`
set:

![](../Images/AutomaticScreenshots/TranslatedSelectSingle13.png)

Complete TCA definition of the field:

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php**

```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',
                    ],
                ],
            ],
        ],
    ],
]
```

## Translated field without `l10n_display` definition {#tca-example-translated-select-single-8}

The following has no `l10n_display` definition:

![](../Images/AutomaticScreenshots/TranslatedSelectSingle8.png)

Complete TCA definition of the field:

**EXT:styleguide/Configuration/TCA/tx_styleguide_elements_select.php**

```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,
                    ],
                ],
            ],
        ],
    ],
]
```
