Jump to:

520 Posts in 248 Topics by 263 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » Tiny MCE Code Strip 2.3.3

Forum for content editors and CMS users.

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

Page: 1
Go to End
Author Topic: 3384 Views
  • 3 midgets In a man suit
    Community Member
    13 Posts

    Tiny MCE Code Strip 2.3.3 Link to this post


    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

  • dalesaurus
    Community Member
    283 Posts

    Re: Tiny MCE Code Strip 2.3.3 Link to this post

    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

    Re: Tiny MCE Code Strip 2.3.3 Link to this post

    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.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.