Project

General

Profile

Actions

Task #102082

open

Epic #99669: CKEditor5 Collection

CKEditor5 - Re-add ability to set maximum allowed char count

Added by Jasmina Ließmann 7 months ago. Updated 7 months ago.

Status:
Accepted
Priority:
Should have
Assignee:
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2023-10-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
cke4
Complexity:
Sprint Focus:

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')}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #102170: CKEditor5: wordCount plugin does not work after updating to TYPO3 v12.4.7ClosedBenjamin Franzke2023-10-14

Actions
Actions #1

Updated by Josef Glatz 7 months ago

  • Target version set to 13 LTS
  • Tags set to cke4
Actions #2

Updated by Josef Glatz 7 months 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

Actions #3

Updated by Josef Glatz 7 months 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.)

Actions #4

Updated by Josef Glatz 7 months ago

  • Status changed from New to Accepted
  • Assignee set to Josef Glatz
Actions #5

Updated by Jasmina Ließmann 7 months ago

  • Related to Bug #102170: CKEditor5: wordCount plugin does not work after updating to TYPO3 v12.4.7 added
Actions #6

Updated by Jasmina Ließmann 7 months 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.

Actions

Also available in: Atom PDF