diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-92423-EnablePlaceholderConfigForCkeditor.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-92423-EnablePlaceholderConfigForCkeditor.rst new file mode 100644 index 0000000000000000000000000000000000000000..2c468b0809bdc8b771d0451ad19844a1796a7ae4 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-92423-EnablePlaceholderConfigForCkeditor.rst @@ -0,0 +1,37 @@ +.. include:: ../../Includes.txt + +======================================================== +Feature: #92423 - Enable placeholder config for ckeditor +======================================================== + +See :issue:`92423` + +Description +=========== + +After the update of ckeditor to version 4.15.0, a new ckeditor plugin, called +**Editor Placeholder**, is now available. More information along with an example +can be found in the official documentation_. + +The placeholder configuration of TCA type `text` is now fed into the ckeditor plugin: + +.. code-block:: php + + 'bodytext' => [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.text', + 'config' => [ + 'placeholder' => 'This is a placeholder', + 'type' => 'text', + 'enableRichtext' => true, + ] + ] + + +Impact +====== + +Editors can now be supported by providing a placeholder text also for the ckeditor. + +.. _documentation: https://ckeditor.com/docs/ckeditor4/latest/examples/editorplaceholder.html + +.. index:: Backend, ext:rte_ckeditor diff --git a/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php b/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php index 8295596960f03530c652feee840c13ce72fa4ced..ba7372ffc917b9ad6ef2606dee9603483531eb0d 100644 --- a/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php +++ b/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php @@ -218,6 +218,9 @@ class RichTextElement extends AbstractFormElement } } $configuration['extraPlugins'] .= ',' . $extraPluginName; + if (isset($this->data['parameterArray']['fieldConf']['config']['placeholder'])) { + $configuration['editorplaceholder'] = (string)$this->data['parameterArray']['fieldConf']['config']['placeholder']; + } $externalPlugins .= 'CKEDITOR.plugins.addExternal('; $externalPlugins .= GeneralUtility::quoteJSvalue($extraPluginName) . ','; diff --git a/typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml b/typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml index 45e3253e4fac4e12eefa23e09aeaf06f26ccb345..0faf80b09ec6c36bcbba997e1109e1c02d689f75 100644 --- a/typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml +++ b/typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml @@ -31,6 +31,7 @@ editor: extraPlugins: - justify - autolink + - editorplaceholder removePlugins: - image diff --git a/typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml b/typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml index a03d21ff4d5fd52435b0252c3b7ef0b0fee02fa5..e4586c0884f5bd44cc70c8d1ceb63527a01d71d7 100644 --- a/typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml +++ b/typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml @@ -55,6 +55,7 @@ editor: - selectall - autolink - wordcount + - editorplaceholder removePlugins: - image