I'm trying to allow the ability to add in an onclick for A tags that are edited in the TinyMCE editor in SS 2.4.7. I've been searching for hours and there is quite a bit of info on this out there but it seems to be either old or isn't working quite like I expect.
I'm trying to set in my mysite/_config.php a complete new list of 'valid_elements' so that I can control exactly what can be put into the editor. Essentially I wanted to add in iframe and scripts, and then add a few extra bits to some of the existing allowed elements to allow onclick="" etc on a tags and style="" etc on images.
I essentially got the full xhtml list from the TinyMCE site and then cut it back to the 'usual' HTML tags my client might use.
So this is what I have in my config:
//******************* HtmlEditorConfig::get('cms')->setOption('valid_elements', 'a[class|coords|href|id|name|onblur|onclick|ondblclick|onfocus|onkeydown| onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover| onmouseup|rel|shape<circle?default?poly?rect|style|tabindex|title|target|type], area[accesskey|alt|class|coords|href|id|onblur|onclick|ondblclick|onfocus| onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout| onmouseover|onmouseup|shape<circle?default?poly?rect|style|tabindex|title| target],blockquote[class|id|style|title], br[class|clear<all?left?none?right|id|style|title], ... (some items removed so it actually shows in this forum) ... ,iframe, img, ... (some items removed so it actually shows in this forum) ... ,tt[class|id|style|title],ul[class|compact<compact|id|style|title|type]'); //*******************
The 'new' tags such as iframe seem to work fine, but I still can't put in an onclick="" on the a tag nor style="" on the image tag.
Any ideas people? Am I putting this in the wrong place? Is there something else I need to do?
Seeing as the forum window messes up the items I've attached the entire command as a txt file.