Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » tinymce.template.js - Add "onclick" for "a" Tag ???

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

Page: 1
Go to End
Author Topic: 3403 Views
  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    tinymce.template.js - Add "onclick" for "a" Tag ??? Link to this post

    hey..
    in file tinymce.template.js I can add for example "style" for the div tag, so when i write

    <div style="margin:0;">hello</div>


    the editor dont removes the "style" code. with the default file there would be

    <div>hello</div>


    in the HTML after "Update".

    soo.. i want to add the ONCLICK for my "a" tags:

    <a href="archive/editpost/250569#" onclick="openPopup('http://mypage.com');">Open Popup</a>


    but the editor removes the "onclick" in my code.. i did add the onclick in the tinymce.template.js file, but it did not work
    i could hard code it in the ".ss" file, but i need this "a-tag" with onclick in my $content, what will be loaded in the .ss file..

    so.. someone can help me?

    valid_elements:
    "+a[id|rel|rev|dir|onclick|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|style],
    -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]",
          extended_valid_elements :
    "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]"
    });

  • SalvaStripe
    Avatar
    Community Member
    89 Posts

    Re: tinymce.template.js - Add "onclick" for "a" Tag ??? Link to this post

    i did change my link, so i did not need the onclick..

    I changed this
    <a href="#" onclick="openPopup('popup-seite/');">Open Popup</a>

    into this
    <a href="javascript:openPopup('popup-seite/');">Popup</a>

    3403 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.