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

# Display conditions in TCA columns {#columns-displaycond}

Display conditions ([$GLOBALS\['TCA'\]\[$table\]\['columns'\]\[$field\]\[displayCond\]](https://docs.typo3.org/permalink/t3tca:confval-columns-displaycond@14.3))
can be used to only display the affected field if certain other fields are set
to certain values.

Conditions can be grouped and nested using boolean operators `AND` or `OR` as
array keys. See examples below.

**Table of contents**

-   [Rules in display conditions](https://docs.typo3.org/permalink/t3tca:rules-in-display-conditions@14.3)
-   [Examples for display conditions](https://docs.typo3.org/permalink/t3tca:examples-for-display-conditions@14.3)
-   [Technical background](https://docs.typo3.org/permalink/t3tca:technical-background@14.3)

## Rules in display conditions {#columns-displaycond-rules}

A rule is a string divided into several parts by ":" (colons). The first part is
the rule-type and the subsequent parts depend on the rule type.

The following rules are available:

-   **FIELD**

    This evaluates based on another field's value in the record.

    -   Part 1 is the field name
    -   Part 2 is the evaluation type. These are the possible options:

        > -   **REQ**
        >
        >     Requires the field to have a "true" value. False values are "" (blank string) and 0 (zero).
        >     Everything else is true. For the REQ evaluation type Part 3 of the rules string must be the string "true"
        >     or "false". If "true" then the rule returns "true" if the evaluation is true. If "false" then the rule
        >     returns "true" if the evaluation is false.
        >
        > -   ****\> / < / >= / <=****
        >
        >     Evaluates if the field value is greater than, less than the value in "Part 3"
        >
        > -   ****= / !=****
        >
        >     Evaluates if the field value is equal to value in "Part 3"
        >
        > -   ****IN / !IN****
        >
        >     Evaluates if the field value is in the comma list equal to value in "Part 3"
        >
        > -   ****\- / !-****
        >
        >     Evaluates if the field value is in the range specified by value in "Part 3" (\[min\] - \[max\])
        >
        > -   ****BIT / !BIT****
        >
        >     Evaluates if the bit specified by the value in "Part 3" is set in the field's value
        >     (considered as an integer)
    -   Part 3 is a comma separated list of string or numeric values

-   **REC:NEW:true**

    This will show the field for new records which have not been saved yet.

-   **REC:NEW:false**

    This will show the field for existing records which have already been saved.

-   **HIDE_FOR_NON_ADMINS**

    This will hide the field for all non-admin users while admins can see it.
    Useful for FlexForm container fields which are not supposed to be edited directly via the FlexForm but
    rather through some other interface.

-   **USER**

    userFunc call with a fully qualified class name.

    Additional parameters can be passed separated by colon:
    `USER:MyVendor\MyExtension\User\MyConditionMatcher->checkHeader:some:more:info`

    The following arguments are passed as array to the userFunc:

    -   `record`: the currently edited record
    -   `flexContext`: details about the FlexForm if the condition is used in one
    -   `flexformValueKey`: `vDEF`
    -   `conditionParameters`: additional parameters

    The called method is expected to return a `bool` value: `true` if the field should be displayed, `false` otherwise.

-   **VERSION:IS**

    Evaluate if a record is a "versioned" record from workspaces.

    -   Part 1 is the type:

        > -   **IS**
        >
        >     Part 2 is "true" or "false": If true, the field is shown only if the record is a version (pid == -1).
        >     Example to show a field in "Live" workspace only: `VERSION:IS:false`

In FlexForm, display conditions can be attached to single fields in sheets, to sheets itself, to flex section fields
and to flex section container element fields. `FIELD` references can be prefixed with a sheet name to
reference a field from a neighbor sheet, see examples below.

> [!TIP]
> Fields used in a condition should have the column option
> [onChange](https://docs.typo3.org/permalink/t3tca:confval-columns-onchange@14.3) set to `reload`.

## Examples for display conditions {#columns-displaycond-examples}

### Basic display condition {#columns-displaycond-examples-basic}

This example will require the field named `tx_myextension_show_teaser` to be
true, otherwise the field for which this rule is set will not be displayed:

```php
'displayCond' => 'FIELD:tx_myextension_show_teaser:REQ:true',
```

### Combining conditions {#columns-displaycond-examples-combined}

Multiple conditions can be combined:

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

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tt_content', [
  'tx_myextension_show_teaser' => [
    'label' => 'Show teaser',
    'onChange' => 'reload',
    'config' => [
      'type' => 'check',
      'renderType' => 'checkboxToggle',
    ],
  ],
  'tx_myextension_teaser' => [
    'label' => 'Teaser',
    'displayCond' => [
      'AND' => [
        'FIELD:tx_myextension_show_teaser:REQ:true',
        'FIELD:header:=:Headline',
      ],
    ],
    'config' => [
      'type' => 'text',
    ],
  ],
]);

ExtensionManagementUtility::addToAllTCAtypes(
  'tt_content',
  'tx_myextension_show_teaser, tx_myextension_teaser',
);

```

An example with multiple values and `OR`:

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

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tt_content', [
  'tx_myextension_layout_note' => [
    'label' => 'Layout note',
    'displayCond' => [
      'OR' => [
        'FIELD:layout:=:1',
        'FIELD:layout:=:2',
        'FIELD:layout:=:3',
      ],
    ],
    'config' => [
      'type' => 'input',
    ],
  ],
]);

ExtensionManagementUtility::addToAllTCAtypes(
  'tt_content',
  'tx_myextension_layout_note',
);

```

This is the same as:

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

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tt_content', [
  'tx_myextension_layout_note' => [
    'label' => 'Layout note',
    'displayCond' => 'FIELD:layout:IN:1,2,3',
    'config' => [
      'type' => 'input',
    ],
  ],
]);

ExtensionManagementUtility::addToAllTCAtypes(
  'tt_content',
  'tx_myextension_layout_note',
);

```

### A complex example {#columns-displaycond-examples-complex}

Going further the next example defines the following conditions: for the
"example_field" field to be displayed, the content element must be in the
default language. Furthermore it must be a text-type element or have the
headline "Example" defined:

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

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tt_content', [
  'tx_myextension_example_field' => [
    'label' => 'Example field',
    'displayCond' => [
      'AND' => [
        'FIELD:sys_language_uid:=:0',
        'OR' => [
          'FIELD:CType:=:text',
          'FIELD:header:=:Example',
        ],
      ],
    ],
    'config' => [
      'type' => 'input',
    ],
  ],
]);

ExtensionManagementUtility::addToAllTCAtypes(
  'tt_content',
  'tx_myextension_example_field',
);

```

### A complex example in a FlexForm {#columns-displaycond-examples-flexform}

Using `OR` and `AND` within FlexForms works like this:

**EXT:my_extension/Configuration/FlexForms/SomeFlexForm.xml**

```xml
<T3DataStructure>
  <sheets>
    <sDEF>
      <ROOT>
        <sheetTitle>General</sheetTitle>
        <type>array</type>
        <el>
          <settings.example>
            <label>Example</label>
            <displayCond>
              <and>
                <value1>FIELD:sys_language_uid:=:0</value1>
                <or>
                  <value1>FIELD:CType:=:text</value1>
                  <value2>FIELD:header:=:Example</value2>
                </or>
              </and>
            </displayCond>
            <config>
              <type>input</type>
            </config>
          </settings.example>
        </el>
      </ROOT>
    </sDEF>
  </sheets>
</T3DataStructure>

```

### Access values in a flexform {#columns-displaycond-examples-flexform-value}

Flex form fields can access field values from various different sources.
Each of the following conditions is an alternative for the `displayCond` of
one field:

```xml
<!-- Hide field if value of record field "header" is not "true" -->
<displayCond>FIELD:parentRec.header:REQ:true</displayCond>
<!-- Hide field if value of parent record field "field_1" is not "foo" -->
<displayCond>FIELD:parentRec.field_1:!=:foo</displayCond>
<!-- Hide field if value of neighbour field "flexField_1 on same sheet is not "foo" -->
<displayCond>FIELD:flexField_1:!=:foo</displayCond>
<!-- Hide field if value of field "flexField_1" from sheet "sheet_1" is not "foo" -->
<displayCond>FIELD:sheet_1.flexField_1:!=:foo</displayCond>
```

## Technical background {#columns-displaycond-technical}

The display conditions are implemented in class
`\TYPO3\CMS\Backend\Form\FormDataProvider\EvaluateDisplayConditions`,
which is a [FormDataProvider](https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ApiOverview/FormEngine/DataCompiling/Index.html#formengine-datacompiling).
It can be used for fields directly in the record as well as for
FlexForm values.
