---
title: "TCA Definition"
manual: "TYPO3 Explained"
version: "11.5"
permalink: "https://docs.typo3.org/permalink/t3coreapi:fal-using-fal-tca@11.5"
source: "ApiOverview/Fal/UsingFal/Tca.rst"
rendered: "2026-10-21T15:30:00+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v11 has reached end-of-life as of October 31th 2024 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# TCA Definition {#fal-using-fal-tca}

This chapter explains how to create a field that makes it possible to
create relations to files.

TYPO3 provides a convenient API for this.
Let's look at the TCA configuration the `image` field of the `tt_content`
table for example (with some parts skipped).

```php
'image' => [
    'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.images',
    'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', [
        'appearance' => [
            'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
        ],
        // custom configuration for displaying fields in the overlay/reference table
        // to use the imageoverlayPalette instead of the basicoverlayPalette
        'foreign_types' => [
            // ...
        ]
    ], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
],
```

The API call is `\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig()`.
The first argument is the name of the current field, the second argument is an override
configuration array, the third argument is the list of allowed file extensions and the
fourth argument is the list of disallowed file extensions. All arguments but the first
are optional.

A call to `\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig()`
will generate a standard TCA configuration for an [inline-type field](https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/Type/Inline/Index.html#columns-inline),
with relation to the `sys_file` table via the `sys_file_reference`
table as "MM" table.

The override configuration array (the second argument) can be used to tweak
this default TCA definition. Any valid property from the `config` section
of inline-type fields can be used.

Additionally, there is an extra section for providing media sources, that come as three buttons per default.

![](../../../Images/AutomaticScreenshots/Fal/FalRelationTca.png)

Which ones should appear for the editor to use, can be configures using TCA
appearance settings:

**EXT:some_extension/Configuration/TCA/Overrides/pages.php**

```php
$GLOBALS['TCA']['pages']['columns']['media']['config']['appearance'] = [
   'fileUploadAllowed' => false,
   'fileByUrlAllowed' => false,
];
```

This will suppress two buttons and only leave "Create new relation".

> [!NOTE]
> Such FAL-enabled fields can also be used inside FlexForms, but there's no API
> to generate the code in such a case.

On the database side, the corresponding field needs just store an integer,
as is usual for relations field:

**EXT:some_extension/ext_tables.sql**

```sql
CREATE TABLE tt_content (
   image int(11) unsigned DEFAULT '0' NOT NULL,
);
```
