HTML Editor Config

To customize the default tinymce configuration you can use HTMLEditorConfig file. Note this functionality is likely to be changed in future releases.

You can customize the installation by adding the following examples to your getCMSFields(). This will normally be found in /mysite/code/Page.php, chances are if it’s not there, you know where to find it.

public function getCMSFields() {
		$fields = parent::getCMSFields();
		
		HtmlEditorConfig::get('cms')->setOption('verify_html', 'false');
 
 		return $fields;
	}

Enabling a Custom Plugin

HtmlEditorConfig::get('cms')->enablePlugins('../../tinymce_ssmacron'); // enables plugin
HtmlEditorConfig::get('cms')->insertButtonsAfter('charmap', 'ssmacron'); // positions plugin

Setting TinyMCE Options (eg valid elements

You can customize any of the TinyMCE options by calling setOption(’optionname’, ‘value’).

HtmlEditorConfig::get('cms')->setOption('verify_html', 'false'); // turn off html validation 
 
htmleditorconfig.txt · Last modified: 2009/09/03 16:30 by ss23

Please use comments for notes, tips and corrections about the described functionality.
Use the Silverstripe Forum to ask questions.

blog comments powered by Disqus
 
Creative Commons LicenseSilverStripe Documentation by SilverStripe is licensed under a Creative Commons Attribution 3.0 New Zealand License.
Based on a work at doc.silverstripe.com
Recent changes RSS feed Driven by DokuWiki