You are here:Home»KB»Web Design»General»Prevent Code stripping in TinyMCE Editor
Friday, 26 February 2010 00:00

Prevent Code stripping in TinyMCE Editor

Written by

when you use certain code in TinyMCE it gets stripped when you save it.


Firstly make sure you have set Joomla's whitelist/blacklist thing properly as descibed in this article.

http://docs.joomla.org/Why_does_some_HTML_get_removed_from_articles_in_version_1.5.8%3F

The easiest way of checking this is to turn off your editor, paste some code in, save the article and see if joomla has stripped the code out.

Now  you need to add some code for your selected HTML Tags in to the Valid Extended Elements field in Tiny Parameters.

Syntax is

tag[element1|element2|etc.],othertag[element1a|element2a|etc.]

Example

{code class="brush: xml"} {/code}

In this case, you can use the star which lets use any element.
object[*],param[*],embed[*]

 You could limit what you authorize and add something like this

object[width|height],param[name|value],embed[src|type|allowscriptaccess|allowfullscreen|width|height]
 

Notes

  • This method can be used for any specific tag one needs not to be cleaned.
  • Parameter Tiny Clean Up on Save to "Always" as advised in the tooltip!
    If you do, then Tiny extraneous mce_something stuff will remain in code, breaking email cloak. as mentioned on joomla forum
  • see here for fijiweb post
     

 

Read 917 times Last modified on Saturday, 08 November 2014 13:00