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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

modifying tinymce to allow SOME users to use javascript

Go to End

2 Posts   1920 Views


Community Member, 8 Posts

30 August 2010 at 2:40pm

I'm new to SS.

I've got 2.4.1 installed.

Two questions:

1. Can I have different tinymce settings for different roles? (If yes, how is that accomplished?)

2. What do I need to change in order to get tinymce to allow the following code:

<a href=";c=40xscf07XuDYgxvFJrVEdOiQ2jC_KyA2dbtJh-WOJIs=" onclick="'\07501iEAR52Ac2Nww-Kte4m_RHQ\75\75\46c\07540xscf07XuDYgxvFJrVEdOiQ2jC_KyA2dbtJh-WOJIs\075', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">email me</a>

The tinymce filter strips the portion of the code.

I've reviewed the instructions at I would prefer not to turn off all validation.


Community Member, 904 Posts

30 August 2010 at 7:28pm

Hi and welcome to SilverStripe

1) I also tried this once. This thread might help you:

2) I strongly discourage from using any JavaScript in the WYSIWYG Editor. It doesn't belong there. And since these Scripts are invisible in the Editor, another person can easily remove them by accident.

There are several ways around that issue though.
A) Create a custom shortcode for popup-windows. The user can then enter the URL and the desired window-size. These docs can help you getting started with sortcodes:,

B) Use jQuery to open some links in a popup window. You could create a special CSS class (eg. "popup") in typography.css which you can then assign in the WYSWYG Editor. Load jQuery in your page and the following Script, and you're set:

;(function($) {
				$(this).attr("href"), "", 
			return false;

All links that have the "popup" class applied will then open in a popup.