Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Upgrading SilverStripe

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Tinymce valid options in 3.x ?


Reply

2 Posts   782 Views

Avatar
martbarr

12 July 2013 at 11:45pm Community Member, 46 Posts

Are they listed anywhere?

I used to use this in 2.4.10 but it breaks somehow in 3.05:-
$htmlEditorConfig = HtmlEditorConfig::get('cms');
$htmlEditorConfig->setOption('forced_root_block','');
$htmlEditorConfig->setOption('force_br_newlines',true);
$htmlEditorConfig->setOption('force_p_newlines',false);
$htmlEditorConfig->setOption('convert_newlines_to_brs',false);
$htmlEditorConfig->setOption('invalid_elements','p');
$htmlEditorConfig->setOption('paste_auto_cleanup_on_past',true);
$htmlEditorConfig->setOption('paste_remove_styles',true);
$htmlEditorConfig->setOption('paste_remove_styles_if_webkit',true);
$htmlEditorConfig->setOption('paste_strip_class_attributes',true);
$htmlEditorConfig->removeButtons('underline', 'ssflash');
   
I need enter key to give me a new line and not a paragraph break, and ideally remove the <p> tags as well although some disagree on that approach.

Anywhere I can look please?
thanks
Martin

Avatar
martbarr

13 July 2013 at 3:49am (Last edited: 13 July 2013 3:49am), Community Member, 46 Posts

These three lines work for me in my _config.php :-

$htmlEditorConfig = HtmlEditorConfig::get('cms');
$htmlEditorConfig->setOption('theme','advanced');
$htmlEditorConfig->setOption('forced_root_block','');

cheers
Martin