Rich text editor (RTE)
The RTE is by default supplied by the system extension typo3/cms-rte-ckeditor . See also the according chapter in TYPO3 explained.
In TCA a RTE is a normal text field with the
option enableRichtext enabled.
Table of contents:
Examples for Rich text editor fields in the TYPO3 Backend
RTE with minimal configuration
The biography of a speaker with the minimal configuration
EXT:my_extension/Configuration/TCA/Overrides/330-tx_myextension_speaker-bio.php
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
ExtensionManagementUtility::addTCAcolumns('tx_myextension_speaker', [
'bio' => [
'label' => 'my_extension.db:speaker.bio',
'config' => [
'type' => 'text',
'enableRichtext' => true,
'richtextConfiguration' => 'minimal',
],
],
]);
ExtensionManagementUtility::addToAllTCAtypes(
'tx_myextension_speaker',
'bio',
'',
'before:--div--;my_extension.db:tab.integration',
);
RTE with full configuration
EXT:my_extension/Configuration/TCA/Overrides/130-tx_myextension_conference-description.php
'enableRichtext' => true,
+ 'richtextConfiguration' => 'full',
Copied!
RTE with default configuration
The description of a conference
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',
);
Properties of the TCA column type text with enabled rich text
Almost all properties of field type text are available.