Skip to content
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

Continue tinymce customization docs #1808

Merged
merged 4 commits into from
Dec 6, 2024
Merged

Conversation

petschki
Copy link
Member

@petschki petschki commented Dec 5, 2024

Continued from #1807 and implemented the comments.

@szakitibi not shure how and where to write the info, that the formats can only be placed on top if you use the third approach ... I'm open for suggestions.


📚 Documentation preview 📚: https://plone6--1808.org.readthedocs.build/

@petschki petschki requested a review from stevepiercy December 5, 2024 15:38
@stevepiercy
Copy link
Contributor

@petschki I made a few more revisions to bring it all together.

Direct link to preview at https://plone6--1808.org.readthedocs.build/classic-ui/tinymce-customization.html

@szakitibi
Copy link

@szakitibi not shure how and where to write the info, that the formats can only be placed on top if you use the third approach ... I'm open for suggestions.

Ok, I think we have only two solutions here. The "Formats+styles" and the tinymce-formats.css configuration are more like complementary to each other, rather then being alternative solutions.

The "Formats" JSON + registration in "Header/Inline/Block/Alignment/Table styles" field will insert the new format in the respective "Formats" submenu like this:

image

On the other hand the tinymce-formats.css registered and configured will add the styles at the top level of the "Formats" menu:

image


The "Formats+styles" solution can be configured two ways:

  1. TTW in the TinyMCE controlpanel - easy for editors.
  2. Using generic setup - meant for plone developers.

The tinymce-formats.css solution is for plone deveopers only, since it requires access to the product source code, its steps are:

  1. Adding the CSS rules in a tinymce-formats.css file.
  2. Registering the file as a plone resource using zcml.
  3. Adding it to the ITinyMCESchema.content_css field in registry using generic setup.

Note: Step 3 is possible via TTW, but the other two steps happen in product code! As far as I see only the generic setup should be documented for tinymce-formats.css solution, since the whole thing is meant for plone developers.

I see no point for mixing TTW into it in this subchapter discussing how to add new formats using tinymce-formats.css. However...


There is the topic of cleaning up the default barceloneta formats, where we have again two options:

  1. The TTW option - easy for editors. Remove the tinymce-formats.css in the controlpanel and edit the "Formats" JSON + styles to remove any formats you do not want.
  2. The generic setup solution - for plone developers. Update the ITinyMCESchema fields as you wish using generic setup in your product.

So the question is more like: What is the target group of this page? Editors? Plone developers? Both?

Depending on the answer the documentation should be split into parts. The GS stuff should be in the plone developers section and the TTW in the editors section of the page.

@stevepiercy
Copy link
Contributor

@szakitibi I see what you're saying, but... read on.


Cleaning up Barceloneta is up for discussion within the Classic UI team for inclusion in Plone 7 or later. That's beyond this PR's purpose, which is focused on Plone 6 Documentation.


"TinyMCE customization" is for all audiences. We try not to cast any roles in Plone 6 Documentation.

For example, let's say I'm performing the role of developer. I'm in a rush and I don't want to take the time to create an add-on. I can just copy-paste stuff from one site to another, as I only maintain two Plone sites, and complete the task in a few minutes.

People search for how to perform a task, not their role. It's a principle from the Diátaxis framework.

It's our job as documentarians to inform people toward making a decision that is appropriate to them. For example, we recently updated documentation for how to Install Plone to do that. As such, we can offer the options and inform readers of the requirements to perform the task, regardless of their role.


After all that, is any of the information in this pull request not accurate? What specifically is missing or needs correction?

Please let me know. Thank you!

@stevepiercy
Copy link
Contributor

@petschki one final review from you, please. I think this is ready to merge.

@petschki
Copy link
Member Author

petschki commented Dec 6, 2024

I cannot review, but approved 👍🏼

@stevepiercy stevepiercy merged commit b264b44 into 6.0 Dec 6, 2024
3 checks passed
@stevepiercy stevepiercy deleted the tinymce-customization-continued branch December 6, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants