From b1e49fb7e10b1603767323a3825e4235c0d24d58 Mon Sep 17 00:00:00 2001 From: Sybille Peters Date: Wed, 8 Nov 2023 08:10:04 +0100 Subject: [PATCH] Optimize RTE page Main point it to add examples for setting a preset via page TSconfig. Additionally, the following changes are made: - add a header for the examples (since examples are now extended and this improves finding the examples when skimming the page) - add clarification what "order" (for the presets) means. If not familiar with TYPO3 one might assume, the order means that the later settings overrides the previous which is not the case: once a setting is set, the ones following it are ignored. - clarify what default (number 4. in the listing of "order") means - add some links --- Documentation/PageTsconfig/Rte.rst | 47 ++++++++++++++++++++++++++---- Documentation/Settings.cfg | 2 +- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Documentation/PageTsconfig/Rte.rst b/Documentation/PageTsconfig/Rte.rst index 65de758e..b472679d 100644 --- a/Documentation/PageTsconfig/Rte.rst +++ b/Documentation/PageTsconfig/Rte.rst @@ -13,12 +13,15 @@ The `RTE` prefix key is used for configuration of the Rich Text Editor. Please refer to the :ref:`RTE chapter ` in Core API document for more general information on RTE configuration and data processing. -The order in which configuration for the RTE is loaded is: +The order in which configuration for the RTE is loaded is (the first one which +is set, is used, see :ref:`example ` below): 1. preset defined for a specific field via PageTS -2. richtextConfiguration defined for a specific field via TCA -3. general preset defined via PageTS -4. default +2. :ref:`richtextConfiguration ` + defined for a specific field via TCA +3. general preset defined via PageTS (:typoscript:`RTE.default.preset`) +4. default (the preset "default", e.g. as defined by EXT:rte_ckeditor or overridden + in :file:`ext_localconf.php`) The full property path building is a bit more complex than for other property segments. The goal is that global options can be set that can @@ -33,7 +36,17 @@ Configure RTE for a specific field in a table Configure RTE for a specific field in a table for a specific :ref:`record type ` `RTE.config.[tableName].[fieldName].types.[type]` -Consider the following Page TSconfig examples: +Configuring RTE via page TSconfig is general and not specific to a +specific RTE editor, however TYPO3 comes with EXT:rte_ckeditor, so this +will usually be used. This page covers only the general configuration, for +more information about configuring rte_ckeditor, see the +:ref:`rte_ckeditor configuration `. + +Examples +======== + +Example: Disable RTE +-------------------- .. code-block:: typoscript :caption: EXT:site_package/Configuration/page.tsconfig @@ -59,6 +72,30 @@ Consider the following Page TSconfig examples: # But disable RTE for tt_content bodytext again if the record type is "text" RTE.config.tt_content.bodytext.types.text.disabled = 1 +.. _pageTsRteOverridePreset: + +Example: Override preset +------------------------ + +Check the description of the order above to see which setting overrides which. + +Summary: + +* Setting the preset via page TSconfig *for a specific field* overrides all + else +* TCA richtextConfiguration (for a specific field) overrides the page TSconfig + default preset (:typoscript:`RTE.default.preset`) + +.. code-block:: typoscript + :caption: EXT:site_package/Configuration/page.tsconfig + + # set a default preset to use as fallback + RTE.default.preset = custom_preset_default + + # Override preset for field "description" in table "tt_address" + RTE.config.tt_address.description.preset = custom_preset_fancy + + Properties ========== diff --git a/Documentation/Settings.cfg b/Documentation/Settings.cfg index d251de4e..29004ca7 100644 --- a/Documentation/Settings.cfg +++ b/Documentation/Settings.cfg @@ -58,7 +58,7 @@ ext_lowlevel = https://docs.typo3.org/c/typo3/cms-lowlevel/main/en-us/ # ext_recycler = https://docs.typo3.org/c/typo3/cms-recycler/main/en-us/ # ext_redirects = https://docs.typo3.org/c/typo3/cms-redirects/main/en-us/ # ext_reports = https://docs.typo3.org/c/typo3/cms-reports/main/en-us/ -# ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ +ext_rte_ckeditor = https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/ # ext_scheduler = https://docs.typo3.org/c/typo3/cms-scheduler/main/en-us/ # ext_seo = https://docs.typo3.org/c/typo3/cms-seo/main/en-us/ # ext_t3editor = https://docs.typo3.org/c/typo3/cms-t3editor/main/en-us/