Skip to content

Instantly share code, notes, and snippets.

@QuingKhaos
Created October 19, 2015 12:54
Show Gist options
  • Save QuingKhaos/f23af6c31e529e25ecd8 to your computer and use it in GitHub Desktop.
Save QuingKhaos/f23af6c31e529e25ecd8 to your computer and use it in GitHub Desktop.
Add a RTE field to tt_content
<?php
// typo3conf/ext/yourext/Configuration/TCA/Overrides/tt_content.php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
$fields = [
'my_rte' => [
'label' => 'Mein RTE',
'config' => ['config' => [
'type' => 'text',
'eval' => 'required,trim',
],
],
];
ExtensionManagementUtility::addTCAcolumns('tt_content', $fields);
// Define the CTypes as comma separated list, to which you want to add your field
ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'my_rte;;;richtext[]:rte_transform[mode=ts];', 'text,textimage');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment