codeEditor 

This page describes the text type with the renderType='codeEditor'.

The renderType='codeEditor' triggers a code highlighter.

The according database field is generated automatically.

The code editor provides an enhanced textarea for TypoScript input, with not only syntax highlighting, but also autocomplete suggestions. Beyond that the code editor makes it possible to add syntax highlighting to textarea fields for several languages.

Example: Code highlighting with code editor 

The embed code of a conference in the code editor

The embed code of a conference in the code editor

EXT:my_extension/Configuration/TCA/Overrides/132-tx_myextension_conference-embed_code.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'embed_code' => [
    'label' => 'my_extension.db:conference.embed_code',
    'config' => [
      'type' => 'text',
      'renderType' => 'codeEditor',
      'format' => 'html',
      'rows' => 7,
      'appearance' => [
        'lineWrapping' => true,
      ],
      'behaviour' => [
        'allowLanguageSynchronization' => true,
      ],
      'searchable' => false,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'embed_code',
  '',
  'after:description',
);
Copied!

Properties of the TCA column type text, render type codeEditor 

Name Type Scope
boolean Proc.
boolean Proc.
array
array
array
string (keyword) Display
boolean Display
integer Display
boolean Display
string Proc.
behaviour
allowLanguageSynchronization
Type
boolean
Default
false
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']['allowLanguageSynchronization']
Scope
Proc.

Allows an editor to select in a localized record whether the value is copied over from default or source language record, or if the field has an own value in the localization. If set to true and if the table supports localization and if a localized record is edited, this setting enables FieldWizard LocalizationStateSelector: Two or three radio buttons shown below the field input. The state of this is stored in a json encoded array in the database table called l10n_state. It tells the DataHandler which fields of the localization records should be kept in sync if the underlying default or source record changes.

EXT:my_extension/Configuration/TCA/Overrides/132-tx_myextension_conference-embed_code.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'embed_code' => [
    'label' => 'my_extension.db:conference.embed_code',
    'config' => [
      'type' => 'text',
      'renderType' => 'codeEditor',
      'format' => 'html',
      'rows' => 7,
      'appearance' => [
        'lineWrapping' => true,
      ],
      'behaviour' => [
        'allowLanguageSynchronization' => true,
      ],
      'searchable' => false,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'embed_code',
  '',
  'after:description',
);
Copied!
appearance
lineWrapping
Type
boolean
Default
false
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['appearance']['lineWrapping']
Scope
Proc.
Added
14.2

When enabled, long lines are wrapped within the editor instead of requiring horizontal scrolling.

EXT:my_extension/Configuration/TCA/Overrides/132-tx_myextension_conference-embed_code.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'embed_code' => [
    'label' => 'my_extension.db:conference.embed_code',
    'config' => [
      'type' => 'text',
      'renderType' => 'codeEditor',
      'format' => 'html',
      'rows' => 7,
      'appearance' => [
        'lineWrapping' => true,
      ],
      'behaviour' => [
        'allowLanguageSynchronization' => true,
      ],
      'searchable' => false,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'embed_code',
  '',
  'after:description',
);
Copied!
fieldControl

For details see fieldControl.

fieldInformation

For details see fieldInformation.

fieldWizard
defaultLanguageDifferences
Type
array
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['defaultLanguageDifferences']

For details see defaultLanguageDifferences.

localizationStateSelector
Type
array
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['localizationStateSelector']

For details see localizationStateSelector.

otherLanguageContent
Type
array
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['otherLanguageContent']

For details see otherLanguageContent.

format 

format
Type
string (keyword)
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['format']
Scope
Display

The value specifies the language the code editor should handle. Allowed values:

  • css
  • html
  • javascript
  • json
  • php
  • sql
  • typoscript
  • xml

See also Code highlighting with the code editor.

readOnly
Type
boolean
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['readOnly']
Scope
Display

Renders the field in a way that the user can see the value but cannot edit it.

rows
Type
integer
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['rows']
Scope
Display

The number of rows in the textarea. May be corrected for harmonization between browsers. Will also automatically be increased if the content in the field is found to be of a certain length, thus the field will automatically fit the content. Default is 5. Max value is 20.

Changed in version 14.0 Breaking: #106976 - Removal of TCA search field configuration options

The following TCA field level search configuration options have been removed:

  • search.case
  • search.pidonly
  • search.andWhere

They have not been supported by the Core or common Extensions.

searchable
Type
boolean
Default
true
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['searchable']
Scope
Display

New in version 14.0

TYPO3 now automatically includes all fields of suitable types in backend search operations in the Content > Records module.

This option can be used to explicitly exclude fields from being searchable, instead of having to list them in the now removed option $GLOBALS['TCA'][$table]['ctrl']['searchFields'].

By default, all fields of type text with rendertype t3editor are considered searchable.

To exclude a field from being searchable, set the following in the field's TCA configuration:

EXT:my_extension/Configuration/TCA/Overrides/132-tx_myextension_conference-embed_code.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'embed_code' => [
    'label' => 'my_extension.db:conference.embed_code',
    'config' => [
      'type' => 'text',
      'renderType' => 'codeEditor',
      'format' => 'html',
      'rows' => 7,
      'appearance' => [
        'lineWrapping' => true,
      ],
      'behaviour' => [
        'allowLanguageSynchronization' => true,
      ],
      'searchable' => false,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'embed_code',
  '',
  'after:description',
);
Copied!
softref
Type
string
TCA path
$GLOBALS['TCA'][$table]['columns'][$field]['config']['softref']
Scope
Proc.
Types
input

Used to attach "soft reference parsers".

The syntax for this value is key1,key2[parameter1;parameter2;...],...

See Soft references of core API for more details about softref keys.