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.

Customising the CMS

tinymce : link + forecolor


Reply

1851 Views

Avatar
erwanpia

29 August 2009 at 10:02pm Community Member, 63 Posts

as usual, bugs in silverstripe are not bugs but features : I was wondering why the forecolor button I added in tiny mce ( line 183 in LeftAndMain.php) was not effectively adding the style color attribute to the zone I had selected

well simpler as ever, LeftAdMain occurs to actually configure authorized tags and attributes for tinymce, and at line 175 the style attribute was not authorized for the span element, which is how the forecolor button in tinymce applies the color, just added the style to span and there we go.

'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|style],-span[class|align|style],-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]",

another great modif I gave to my customer was reverting to the tinymce standard link feature, silverstripe is well thought but badly implemented (messes with the typed string, especially when worjking with links over images and texts)

http://silverstripe.org/content-editor-discussions/show/256287