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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

tinymce.template.js - Add "onclick" for "a" Tag ???


Go to End


2 Posts   7279 Views

Avatar
SalvaStripe

Community Member, 89 Posts

17 December 2008 at 12:18am

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]"
});

Avatar
SalvaStripe

Community Member, 89 Posts

17 December 2008 at 12:54am

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>