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.

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   1215 Views

Avatar
Neelam

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

Avatar
Neelam

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'?