Issues: TinyMCE loading styles in the Editor and a solution

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jsmonzani
Forum Members
Forum Members
Posts: 54
Joined: Mon Apr 03, 2006 10:58 am

Issues: TinyMCE loading styles in the Editor and a solution

Post by jsmonzani »

This is an answer to the question raised here:
viewtopic.php?f=8&t=74514
(unfortunately the topic is locked).

I've run into this problem with TinyMCE 3.1.4 and CMSMS 2.2.3.1, where my custom stylesheet doesn't always load in TinyMCE.
Here's my solution.

I've got to say that I use static CSS files in my designs. But creating a CSS in CMSMS and attaching it to a Design didn't work with TinyMCE, it just randomly loads the CSS in TinyMCE (sometimes it works, sometimes not).
In order to make TinyMCE behave correctly, I'm gonna create a static CSS just for it.

- I've created a static css file, for example /site/css/tinymce.css
- I've installed TinyMCE 3.2-beta3
- In CMSMS Layout menu, select Design Manager, then Template Types / Prototypes and look for TinyMCE::JavaScript. Click the icon on the right to create a new template of this type (for good measure, you can edit it and copy its content but this will be done automatically)
- Now in your Templates section (of the Design Manager), you should have a new TinyMCE::JavaScript content, I've called mine Tiny_MCE_JSM_custom_CSS
- Edit this file and look for
{if isset($content_css) && $content_css != ''}
content_css: '{$content_css}',
{/if}
and remplace it with your custom static CSS
content_css: '/site/css/tinymce.css',
(dont forget the "," at the end of the line)
- Now open Extensions -> TinyMCE WYSIWYG editor, choose your profile, go to template and select your new Javascript template (mine is Tiny_MCE_JSM_custom_CSS)
- This should work!

Hope this helps!

On a sidenote, I've noted that the bullets lists don't work anymore in TinyMCE unless you add
lists advlist
to your plugins.

Cheers
Post Reply

Return to “Modules/Add-Ons”