Skip to content

Commit

Permalink
[FEATURE] Use the ckeditor plugin editorplaceholder
Browse files Browse the repository at this point in the history
Enable the ckeditor plugin editorplaceholder which is available since
the update of ckeditor to version 4.15.0 with #92412 and fill it with
the placeholder information provided by the TCA.

Resolves: #92423
Releases: master
Change-Id: Ie392073d200a193b2be5f245042f0914f7665cdd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65899
Tested-by: Torben Hansen <derhansen@gmail.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Torben Hansen <derhansen@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
georgringer authored and andreaskienast committed Sep 26, 2020
1 parent 7af1764 commit b06cc92
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ protected function getCkEditorRequireJsModuleCode(string $fieldId): string
}
}
$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) . ',';
Expand Down
1 change: 1 addition & 0 deletions typo3/sysext/rte_ckeditor/Configuration/RTE/Default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ editor:
extraPlugins:
- justify
- autolink
- editorplaceholder

removePlugins:
- image
Expand Down
1 change: 1 addition & 0 deletions typo3/sysext/rte_ckeditor/Configuration/RTE/Full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ editor:
- selectall
- autolink
- wordcount
- editorplaceholder

removePlugins:
- image
Expand Down

0 comments on commit b06cc92

Please sign in to comment.