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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

Silverstripe 3.0- script tags getting stripped from editor content after save and publish

Go to End

2 Posts   1008 Views


Community Member, 15 Posts

2 October 2012 at 9:26pm

I need to extend the allowed tags in SilverStripe 3.0 editor (Tinymce) and also allow javascript in it

I added the below code in mysite/_config.php:

HtmlEditorConfig::get('cms')->setOptions(array('valid_elements' => "*

  • "));

    above code works and tags like form and input are accepted....

    But its not accepting javascript..(i have tried alert('hello');) It remains after clicking update on the editor, but gets stripped after clicking 'save and publish'

    same code in version 2.4.7 accepted script but it was commented out and CDATA was added..

    please tell me how i can allow javascript in the editor.....


Community Member, 15 Posts

2 October 2012 at 9:28pm

Edited: 02/10/2012 9:28pm

Does 3.0 have some clean up mechanism to strip javascript after you click on 'save and publish'?