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.

Customising the CMS

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


Reply

2 Posts   561 Views

Avatar
Neelam

2 October 2012 at 9:26pm Community Member, 15 Posts

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.....

Avatar
Neelam

2 October 2012 at 9:28pm (Last edited: 2 October 2012 9:28pm), Community Member, 15 Posts

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