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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Tinymce valid options in 3.x ?


Go to End


2 Posts   2319 Views

Avatar
martbarr

Community Member, 59 Posts

12 July 2013 at 11:45pm

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

Community Member, 59 Posts

13 July 2013 at 3:49am

Edited: 13/07/2013 3:49am

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