Reputation: 63
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.....
Upvotes: 2
Views: 1513
Reputation: 1402
This was reported and resolved, however isn't slated to be released until 3.3: https://github.com/silverstripe/silverstripe-framework/issues/3611
For a short-term workaround you could try: https://github.com/kinglozzer/htmleditorscripts
Upvotes: 1