TinyMCE configuration

Here is some guides for setting options in TinyMCE

This is from my _config.php

HtmlEditorConfig::get('cms')// Add support for HTML5 elements in tinymce editor
	->setOption('extended_valid_elements',
		'+article,aside,audio[src|preload<none?metadata?auto|autoplay<autoplay|loop<loop|controls<controls|mediagroup],canvas[width,height],'
		.'datalist[data],details[open<open],eventsource[src],fieldset[disabled<disabled|form|name],header,mark,menu[type<context?toolbar?list|label],'
		.'meter[value|min|low|high|max|optimum],nav,progress[value,max],script[src|async<async|defer<defer|type|charset],section,time[datetime],'
		.'video[preload<none?metadata?auto|src|crossorigin|poster|autoplay<autoplay|mediagroup|loop<loop|muted<muted|controls<controls|width|height],wbr,#span,'
		.'form[id|method|onsubmit|onreset|action],input[id|name|style|type|placeholder],label[for]'
	)
	->setOptions(array(//clean up the actions upon pasting text in
		'paste_remove_spans' 			=> true,
		'paste_remove_styles' 			=> true,
		'paste_remove_styles_if_webkit' => true,
		'force_br_newlines' 			=> true,
		'force_p_newlines' 				=> false,
		'paste_text_linebreaktype' 		=> "br",
		'paste_remove_styles' 			=> true,
		'paste_auto_cleanup_on_paste' 	=> true,
	));
Rate this post (1 ratings)

Post your comment

Comments

  • Jono M 24/04/2016 8:47pm (2 years ago)

    For help with configuring the 'Style' drop-down menu check out: https://github.com/jonom/silverstripe-tinytidy

RSS feed for comments on this page | RSS feed for all comments