Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

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

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

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

Page: 1
Go to End
Author Topic: 4036 Views
  • Fabie
    Avatar
    Community Member
    28 Posts

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

    Hi,

    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],
    br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],
    -sub[class],-sup[class],-blockquote[dir|class],
    -table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],
    -tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],
    tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],
    -td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],
    -th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],
    caption[id|dir|class],-div[id|dir|class|align],-span[class|align],-pre[class|align],
    address[class|align],-h1[id|dir|class|align],-h2[id|dir|class|align],-h3[id|dir|class|align],
    -h4[id|dir|class|align],-h5[id|dir|class|align],-h6[id|dir|class|align],hr[class],
    dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir]",

    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

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Forcing SilverStripe/TinyMCE to eat code such as iframe and script Link to this post

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

  • zyko
    Avatar
    Community Member
    66 Posts

    Re: Forcing SilverStripe/TinyMCE to eat code such as iframe and script Link to this post

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

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