Skip to content

Conversation

@i-just
Copy link
Contributor

@i-just i-just commented Sep 4, 2025

Description

When the CKEditor field is rendered statically (when viewing a revision or when the editability condition is not met), we show the field’s raw HTML content and don’t instantiate CKEditor itself.

While this approach technically does what is expected and prevents the field from being editable, it can be a bit confusing when the field is empty, making it look like it wasn’t rendered. It also doesn’t show the content in a WYSIWYG way.

To improve this, I have switched the Field::getStaticHtml() method to initialise the CKEditor, but in read-only mode.

We could also hide the toolbar when in read-only mode, but I’m not sure if that’s beneficial. Keeping it in means that some features are still available. For example, you can still use the “find” part of the “Find and Replace” feature.

A separate PR was raised for v4: #467.

Related issues

#465

@i-just i-just requested a review from brandonkelly as a code owner September 4, 2025 10:09
@i-just i-just changed the title when in static mode, render the cke field as read-only (v3) Bugfix/465 static cke field UI v3 Sep 4, 2025
@brandonkelly brandonkelly merged commit 937041a into 3.x Nov 15, 2025
@brandonkelly brandonkelly deleted the bugfix/465-static-cke-field-ui-v3 branch November 15, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants