TinyMCE Initialisation and valid_strings etc


One of our customers has an issue when editing content originally created using the CMS5 Editor. In particular, tinyMCE refuses to have empty <td> elements and adds &nbsp; entries as soon as the content is loaded into the editor. This results in broken layout, as these tables have empty 'height=1' td elements which render OK if the elements are empty, but are rendered at the relevant line height (I think) if an &nbsp; is present.

I've looked in the documentation on moxiecode for tinyMCE and it appears that if I specify "#td" rather than "td" in the valid_elements setting for tinyMCE, then empty table cells become valid.

So, how do I set the valid_elements setting, and what is the default setting in EPiServer for valid_elements?

Also, is there a config file for this, or do I have to write code??



May 31, 2011 19:34

I think you have to create a plug-in to alter the configuration settings:

[TinyMCEPluginNonVisualAttribute(AlwaysEnabled=true, EditorInitConfigurationOptions = "{ extended_valid_elements : 'td'}")   ]
public class TinyMCEValidElements { }

The class name is irrelevant. Only the plug-in attribute options are used.


The valid_elements configuration is left at the defaults specified in tinyMCE, so if you need to change it you have to copy the default value from the tinyMCE documentation. If you can solve the problem by using the extended_valid_elements, you won't have to copy the entire default rule. Also, the table plugins adds configuration to extended_valid_elements aswell.

More information on adding tinyMCE plug-ins:


Edited, Jun 08, 2011 13:54
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.