For this tutorial I assume you are working with rte_ckeditor. At the time of writing I used TYPO3 8, and should work for upcoming versions as well.
This is what we need to do:
Let's get to it!
If you don't have one already, create a new AdditionalConfiguration.php file in your typo3conf folder. In this file we're going to add a new configuration preset. Feel free to change the preset name and path to whatever suits your need.
<?php
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['customEditor'] = 'fileadmin/rte/customEditor.yaml';
?>
ProTip: Just repeat this line if you want to add multiple configurations.
In the location you decided on in the snippet above, create the customEditor.yaml file. I suggest you start with a base template. Luckily the ckeditor comes with a few templates to start from. You can find these in the following location:
typo3/sysext/rte_ckeditor/Configuration/RTE/
Here are a few base templates we can copy to our file. Default, Full, or Minimal.yaml. I went with minimal, and added a few buttons based on the Full template.
# Load default processing options
imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
# Minimal configuration for the editor
editor:
config:
toolbarGroups:
- { name: basicstyles, groups: [ basicstyles] }
- { name: clipboard, groups: [clipboard, undo] }
- { name: insert }
- { name: document, groups: [ mode, document, doctools ] }
removeButtons:
- Anchor
- Superscript
- Subscript
- Underline
- Strike
- SpecialChar
- HorizontalRule
- Image
This configuration adds the Table, and Source Code button to the minimal layout.
Now in your DCE module, add a normal RTE Textarea. And simply use your newly created preset in the configuration.
<config>
<type>text</type>
<rows>5</rows>
<cols>30</cols>
<eval>trim</eval>
<enableRichtext>1</enableRichtext>
<richtextConfiguration>customEditor</richtextConfiguration>
</config>
Here's one last tip, if you didn't know this already. Remember the base templates provided by rte_ckeditor? You can use these base templates in DCE right now, by simply changing your richtextConfiguration to Default, Full, or Minimal.