17488 Posts in 4473 Topics by 1978 members
|Go to End|
19 May 2008 at 10:38pm Last edited: 19 May 2008 10:39pm
I need to add custom styles (new classes and new styles to p, h,...).
I want to add this styles in editors drop down menu.
I have read TinyMCE manual and add content_css with my styles but in doesnÃ‚Â´t work...
Wich is the right way to do it?
Thanks in advance...
20 May 2008 at 1:32am
Hey nomen, we needed to do the same thing for our projects just recently. You can go into the HtmlEditorField.php file in sapphire/forms/ and go down to line 248. This will probably have a commented line that is a style dropdown for the editor. If you uncomment it, that will allow you to add custom styles to select and place their definitions in typography.css . That should get you started.
20 May 2008 at 9:25pm Last edited: 20 May 2008 9:31pm
It works, but if i put my classes in editor.css instead of typography.css.
I added this in HtmlEditorField.php
new HtmlEditorField_dropdown("mceSetCSSClass", "styleSelect", array(
"mceContentBody" => "mceContentBody",
"red-text" => "red-text",
In editor.css i put
In the CMS editor i see the dropdown with red-text. It appears two times, i donÃ‚Â´t know why. One of then works perfectly and the other does nothing.
The correct one creates
It is perfect for me.
But i need also to create <div id="red-text">mytext</div> and i donÃ‚Â´t know ho to do it. I try to create in editor.css
But it doesnÃ‚Â´t work. Is there a way to do it?
By the way, i read HtmlEditorField_dropdown api info but i think i donÃ‚Â´t understand correcty how it works and how to use it. Can somebody explain it?
Thank you in advance.
|Go to Top|