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:

Content Editor Discussions /

Forum for content editors and CMS users.

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

Tiny MCE Code Strip 2.3.3

Go to End

3 Posts   4312 Views

3 midgets In a man suit

Community Member, 13 Posts

6 October 2009 at 5:47am


I am having an issue, or should I say have been having an issue with silverstripe not letting me put any kind of code into the individual pages.

I need to have the ability to do some basic javascript and other things on individual pages such as set parameters etc. on flash files but it strips everything
<a href="#"
onmouseover="changeImages('checkbutton_01', 'images/checkbutton_01-over.gif'); return true;"
onmouseout="changeImages('checkbutton_01', 'images/checkbutton_01.gif'); return true;"
onmousedown="changeImages('checkbutton_01', 'images/checkbutton_01-over.gif'); return true;"
onmouseup="changeImages('checkbutton_01', 'images/checkbutton_01-over.gif'); return true;">
<img name="checkbutton_01" src="images/checkbutton_01.gif" width="219" height="81" border="0" alt=""></a>

I would also like to be able to do includes at the editing level e.g.
<% include packages %>

any help would be greatly appreciated


Community Member, 283 Posts

14 October 2009 at 4:30am

Generally you should be adding custom javascript via a template or using a separate file that gets included.

However if you are certain you want to be using TinyMCE to input javascript you'll have to set some options to stop it from stripping elements. The editor in the CMS is controlled via PHP calls in your _config.php file:

For Javascript you'll want to add something like this to extended_valid_elements


There are many more options you can work with, see the TinyMCE docs:

You might want to be very thorough and set invalid_elements to nothing.

PS. This is a pretty common question, it is covered in many topics you can find via the Search. If you get this to work to your satisfaction please let us know in here and I will be sure to add it to the wiki.

Chip Designs

Community Member, 15 Posts

16 April 2010 at 10:29pm

Edited: 16/04/2010 10:30pm

Hi Dalesaurus,

I'm, using SS 2.3.7 - Adding script[language|type|src] to the extended_valid_elements found in cms\_config.php seemed to do the trick for me.