Text areas & RTE 

New in version 13.0

The according database fields for all render types are generated automatically.

Introduction 

The text type is for multi-line text input, in the database ext_tables.sql files it is typically set to a TEXT column type. In the backend, it is rendered in various shapes: It can be rendered as a simple <textarea> , as a rich text editor (RTE), as a code block with syntax highlighting, and others.

The following renderTypes are available:

  • default: A simple text area or a rich text field is rendered, if no renderType is specified.
  • belayoutwizard: The backend layout wizard is displayed in order to edit records of table backend_layout in the backend.
  • codeEditor: This render type triggers a code highlighter.

    Changed in version 13.0

    In previous TYPO3 versions, the code editor was available via the system extension "t3editor". The functionality was moved into the system extension "backend". The render type t3editor was renamed to codeEditor. A TCA migration from the old value to the new one is in place.

  • textTable: The renderType = 'textTable' triggers a view to manage frontend table display in the backend. It is used for the "table" tt_content content element.

Simple text area 

A simple text area or a rich text field is rendered, if no renderType is specified.

The abstract of a talk

The abstract of a talk

See render type "default" on how to configure such an editor.

EXT:my_extension/Configuration/TCA/Overrides/225-tx_myextension_talk-abstract.php
<?php

use MyVendor\MyExtension\Evaluation\AbstractEvaluation;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_talk', [
  'abstract' => [
    'label' => 'my_extension.db:talk.abstract',
    'config' => [
      'type' => 'text',
      'cols' => 40,
      'rows' => 5,
      'eval' => 'trim,' . AbstractEvaluation::class,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_talk',
  'abstract',
  '',
  'before:--div--;core.form.tabs:access',
);
Copied!

Rich text editor field 

The description of a conference

The description of a conference

See property "enableRichtext" on how to configure such an editor.

EXT:my_extension/Configuration/TCA/Overrides/130-tx_myextension_conference-description.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'description' => [
    'label' => 'my_extension.db:conference.description',
    'l10n_mode' => 'prefixLangTitle',
    'config' => [
      'type' => 'text',
      'enableRichtext' => true,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'description',
  '',
  'before:--div--;core.form.tabs:categories',
);
Copied!

Code highlight editor 

The embed code of a conference in the code editor

The embed code of a conference in the code editor

See codeEditor on how to configure such an 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!

Backend layout editor 

The backend layout wizard is displayed in order to edit records of table backend_layout in the backend.

The backend layout wizard

The backend layout wizard

See render type belayoutwizard on how to configure such an editor.

EXT:frontend/Configuration/TCA/backend_layout.php
<?php

return [
  'ctrl' => [
    'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:backend_layout',
    'label' => 'title',
    'descriptionColumn' => 'description',
    'tstamp' => 'tstamp',
    'crdate' => 'crdate',
    'versioningWS' => true,
    'groupName' => 'system',
    'sortby' => 'sorting',
    'delete' => 'deleted',
    'enablecolumns' => [
      'disabled' => 'hidden',
    ],
    'typeicon_classes' => [
      'default' => 'mimetypes-x-backend_layout',
    ],
    'selicon_field' => 'icon',
    'security' => [
      'ignorePageTypeRestriction' => true,
    ],
  ],
  'columns' => [
    'title' => [
      'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:backend_layout.title',
      'config' => [
        'type' => 'input',
        'size' => 25,
        'max' => 255,
        'required' => true,
      ],
    ],
    'config' => [
      'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:backend_layout.config',
      'config' => [
        'type' => 'text',
        'renderType' => 'belayoutwizard',
      ],
    ],
    'icon' => [
      'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:backend_layout.icon',
      'exclude' => true,
      'config' => [
        'type' => 'file',
        'allowed' => 'common-image-types',
        'relationship' => 'manyToOne',
        'appearance' => [
          'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference',
        ],
      ],
    ],
  ],
  'types' => [
    '1' => [
      'showitem' => '
        --div--;core.form.tabs:general,
          title,icon,config,
        --div--;core.form.tabs:access,
          hidden,
        --div--;core.form.tabs:notes,
          description,
        --div--;core.form.tabs:extended,
      ',
    ],
  ],
];
Copied!

Text field with renderType textTable 

The ticket prices of a conference

The ticket prices of a conference

See render type textTable on how to configure such an editor.

EXT:my_extension/Configuration/TCA/Overrides/133-tx_myextension_conference-prices.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addTCAcolumns('tx_myextension_conference', [
  'prices' => [
    'label' => 'my_extension.db:conference.prices',
    'config' => [
      'type' => 'text',
      'renderType' => 'textTable',
      'rows' => 5,
    ],
  ],
]);
ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_conference',
  'prices',
  '',
  'after:embed_code',
);
Copied!