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.


Our old forums are still available as a read-only archive.

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

Forcing SilverStripe/TinyMCE to eat code such as iframe and script


3 Posts   4199 Views


24 July 2008 at 9:11pm (Last edited: 24 July 2008 9:14pm), Community Member, 28 Posts


I had been searching for a solution for this for a looong looong while. I needed to find a way to get SS to allow me to paste code such as <iframe> and scripts. (eg. add GoogleMap iframe)

After an initial search on the IRC I got help and was told it was related to TinyMCE blocking it.

Eventually Gnx-_ and dio5 found the solution and I traced it back on the IRC channel logs... tonite I implemented the solution they proposed and it solved my issue. I am not sure they posted the solution so I thought I would put it here.

Navigate to /cms/javascript/tinymce.template.js

Replace this:

   valid_elements : "+a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align],-ol[class],-ul[class],-li[class],

by this:

valid_elements : "*

  • ", (for some reason the forum won't display the whole thing so it is

    valid_elements : quote star open square bracket star close square bracket quote coma

    And you are done. Thanks Gnx-_ and dio5 you made my day, actually... week, no MONTH!

    fabie :):):)


24 July 2008 at 10:12pm Forum Moderator, 5511 Posts

Nice :D you might like to put this on the wiki as I assume there is alot of other people in your situation!


30 July 2008 at 4:25am Community Member, 66 Posts

THX Fabie, dio5 and Gnx-_
you made my day :-)