-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow TinyMCE to be used in inline-mode #3465
Comments
For reference, in Plone 5 you can activate inline editing like so:
|
With the current solution you can globally enable or disable inline mode in the TinyMCE controlpanel and still disable or enable it by schema-field for specific types or behaviors using What I did not see earlier is that the tinymce-pattern actually uses this setting to replace the textarea with a div before instanciating tinymce. So no changes to RichTextWidget are required. |
Tests are green. |
Branch: refs/heads/main Date: 2022-04-13T10:26:48+02:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.base@a93dc62 Add inline mode to tinymce config (see plone/Products.CMFPlone#3465) Files changed: M src/plone/base/interfaces/controlpanel.py Repository: plone.base Branch: refs/heads/main Date: 2022-04-13T10:29:27+02:00 Author: Philip Bauer (pbauer) <bauer@starzel.de> Commit: plone/plone.base@f1d412f add changenote Files changed: A news/7.feature Repository: plone.base Branch: refs/heads/main Date: 2022-04-13T12:27:04+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.base@d22ddbd Merge pull request #7 from plone/tiny_inline_mode Add inline mode to tinymce config Files changed: A news/7.feature M src/plone/base/interfaces/controlpanel.py
Alles gemerget. |
Inline-mode of TinyMCE (https://www.tiny.cloud/docs/demo/inline) is nice among other reasons because the edited text looks exactly the way as the saved result.
To enable it you could simply set
{"inline": "true"}
as the value in the field "Other settings" of the TinyMCE controlpanel. That is enough to trigger it.But that fails with
Could not initialize inline editor on invalid inline target element
since the html-tag that renders the TinyMCE is a<textarea>
. See https://www.tiny.cloud/blog/tinymce-inline-option-not-working for details about that constraint.The
<textarea>
thing is defined inplone.app.z3cform.widget.RichTextWidget
which hasTextareaWidget
as_base
. Inrender_input_mode
of the widget it is possible to conditionally render a different html element likediv
around the text. But then fallback to textarea no longer works and saving also fails and and and...So it seems that using inline-mode in not straightforward. The question is do we like that option enough to do the required work?
The text was updated successfully, but these errors were encountered: