change output of wysiwyg underline
9 posts by 3 authors in: Forums > CMS Builder
Last Post: April 3, 2012 (RSS)
By squeazel - March 29, 2012
Elsewhere in the forums I see how to customize the style of elements such as anchors or headings, however since this is an inline style and not an element I'm not sure how to change this.
If it's not possible to do up-front, can I adjust the inline style on the fly using php?
thank you!
Re: [charnushka] change output of wysiwyg underline
By zip222 - March 30, 2012
Re: [zip222] change output of wysiwyg underline
By squeazel - March 30, 2012
Re: [charnushka] change output of wysiwyg underline
By (Deleted User) - April 3, 2012
I just had a quick look over at TinyMCE's forum to see if this has come up before - this thread http://www.tinymce.com/forum/viewtopic.php?id=12291 contains a lot of information about why they don't natively support the <u> tag.
After reading through that, I have the following solution to offer you (if you're up for editing the code directly) - add this:
formats : {
underline : {inline : 'span', 'classes' : 'underline', exact : true},
}
to cmsAdmin/lib/wysiwyg.php at about line 53 (after 'tinyMCE.init {...')
This will force the 'undeline' button to add a span to the selected text with the class 'underline' (which you can then set in your main css for the site).
Let me know if this helps.
Tom
Re: [Tom P] change output of wysiwyg underline
By squeazel - April 3, 2012
Thanks so much for looking in that. The solution works perfectly, with one exception. While the actual site output is now great, the display within the WYSIWYG editor no longer shows the text as being underlined. It is underlined (i.e., if I put my cursor on it the u button highlights) but it's no longer showing that way in the editor. Any thoughts? Otherwise, this solution is perfect.
thanks!
Re: [charnushka] change output of wysiwyg underline
By (Deleted User) - April 3, 2012
To do that you'll need to edit cmsAdmin/lib/wysiwyg.css (save it as wysiwyg_custom.css) and add the following above the "site specific.." info box:
body.mceContentBody.underline {
text-decoration:underline;
}
This will add the 'underline' class to the everything that is drawn inside the tinyMCE window, so the spans with the underline class will have a style assigned to them!
Let me know if this helps,
Tom
Re: [Tom P] change output of wysiwyg underline
By squeazel - April 3, 2012
.underline {
text-decoration:underline;
}
Re: [charnushka] change output of wysiwyg underline
By zip222 - April 3, 2012
body.mceContentBody .underline {
text-decoration:underline;
}