Bug 34839

Summary: Shouldn't TinyMCE initialise with the Koha interface stylesheet?
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: ToolsAssignee: Owen Leonard <oleonard>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: matt.blenkinsop
Version: MainKeywords: Academy
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6419
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 34840    

Description Martin Renvoize (ashimema) 2023-09-20 09:59:32 UTC
When we initialise TinyMCE in the HTML Customisation page we pass `content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css"`.

Shouldn't we be passing the stylesheet/stylesheets of the interface we're editing rather than a specific tinymce sheet?  That would more accurately represent how your content block is actually going to appear to the end user than it does now.. for example taking account of page-section classes if you add such a div into your markup?

Or am I mis-understanding what the content_css option does?
Comment 1 Martin Renvoize (ashimema) 2023-09-20 10:20:11 UTC
`content_style:` could also be used to include the *UserCSS preference contents
Comment 2 Martin Renvoize (ashimema) 2023-09-20 10:21:57 UTC
Where I see challenges creeping in..

* Where we use a content block on both Staff and OPAC
* Dynamically switching sheet after initial load when selecting the display location/interface
Comment 3 Martin Renvoize (ashimema) 2023-09-20 10:27:19 UTC
https://www.tiny.cloud/docs/tinymce/6/add-css-options/ is probably helpful