Task #102082
openEpic #99669: CKEditor5 Collection
CKEditor5 - Re-add ability to set maximum allowed char count
0%
Description
Scenario:
I have a content element with a text field. From a conceptual and graphical perspective, this text field should contain a maximum of 250 characters. This can be achieved using TCA:
'columns' => [
'bodytext' => [
'config' => [
'max' => 250,
],
],
],
In order to create barrier-free websites, it is necessary to be able to mark language changes in the text. In order to ensure this requirement and to enable the editor to mark language changes in the text, the RTE is activated for the text field. However, it is now no longer possible to assign a maximum number of characters via TCA to the text field.
In former TYPO3 versions that used CKeditor4, there was a plugin with which, among other things, the maximum number of characters could be set (https://ckeditor.com/cke4/addon/wordcount).
editor:
external plugins:
wordcount:
maxCharCount: 250
From TYPO3 v12 onwards, CKEditor5 is used, which comes with a plugin of the same name as standard. However, this only contains a fraction of the configuration options of the plugin for CKeditor4. Among other things, there is no option to define a maximum number of characters:
https://ckeditor.com/docs/ckeditor5/latest/features/word-count.html
Workaround:
My current workaround is to add a description for the field in the TCA, which tells the editor the intended maximum number of characters. However, the editor can insert any amount of text in the RTE field. In the Fluid template, the text is then shortened using Fluid ViewHelper:
{data.bodytext -> f:format.crop(maxCharacters: '250', respectWordBoundaries: '1')}
Updated by Josef Glatz about 1 year ago
- Target version set to 13 LTS
- Tags set to cke4
Updated by Josef Glatz about 1 year ago
- Tracker changed from Feature to Task
- Subject changed from CKEditor5 - Add ability to set maximum allowed char count to CKEditor5 - Re-add ability to set maximum allowed char count
- TYPO3 Version set to 13
This functionality was part until TYPO3 11.5¶
I therefore suggest to fix this as TASK.
The previous commit for wordcount: https://review.typo3.org/c/Packages/TYPO3.CMS/+/58405
Updated by Josef Glatz about 1 year ago
Update: I plan to have a discussion with @Benjamin Franzke¶
I have some ideas which I want to discuss with Benjamin first. There might be some scenarios where we can add synergies from TCA config and RTE presets.
The appointment is planned for next week Tuesday (17.10.)
Updated by Josef Glatz about 1 year ago
- Status changed from New to Accepted
- Assignee set to Josef Glatz
Updated by Jasmina Ließmann about 1 year ago
- Related to Bug #102170: CKEditor5: wordCount plugin does not work after updating to TYPO3 v12.4.7 added
Updated by Jasmina Ließmann about 1 year ago
- TYPO3 Version changed from 13 to 12
- PHP Version set to 8.2
@Josef Glatz Thanks for taking care of this. I have already spoken to Benjamin Kott and Andreas Nedbal to make this a task in the current version 12.
Updated by Benni Mack about 1 month ago
- Target version changed from 13 LTS to Candidate for Major Version