Text areas & RTE
New in version 13.0
When using the text type, TYPO3 takes care of
generating the according database field.
A developer does not need to define this field in an extension's
ext_tables.sql file.
The according database fields for all render types are generated automatically.
Table of contents:
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 render 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_in the backend.layout -
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
t3editorwas renamed tocode. A TCA migration from the old value to the new one is in place.Editor - textTable: The
rendertriggers a view to manage frontend table display in the backend. It is used for the "table"Type = 'text Table' tt_content element.content
Simple text area
A simple text area or a rich text field is rendered, if no renderType is specified.
The abstract of a talk
See render type "default" on how to configure such an editor.
<?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',
);
Rich text editor field
The description of a conference
See property "enableRichtext" on how to configure such an editor.
<?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',
);
Code highlight editor
The embed code of a conference in the code editor
See codeEditor on how to configure such an editor.
<?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',
);
Backend layout editor
The backend layout wizard is displayed in order to edit records of table
backend_ in the backend.
The backend layout wizard
See render type belayoutwizard on how to configure such an editor.
<?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,
',
],
],
];
Text field with renderType textTable
The ticket prices of a conference
See render type textTable on how to configure such an editor.
<?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',
);