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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Problem with CMS stripping out code...


Reply

3 Posts   722 Views

Avatar
lozhowlett

22 February 2011 at 12:20am (Last edited: 22 February 2011 12:21am), Community Member, 146 Posts

Hi all,

I have the latest version of SS installed and made an amend to mysite/_config.php..

HtmlEditorConfig::get('cms')->insertButtonsAfter('formatselect', 'forecolor');
HtmlEditorConfig::get('cms')->insertButtonsAfter('forecolor', 'backcolor');
HtmlEditorConfig::get('cms')->insertButtonsAfter('backcolor', 'removeformat');
HtmlEditorConfig::get('cms')->setOption('apply_source_formatting', 'false');
HtmlEditorConfig::get('cms')->setOption('verify_html', 'false');
HtmlEditorConfig::get('cms')->setOption('valid_elements', 'a[href|target|rel|class],b,br,font,img[src|id|width|height|align|hspace|vspace|style],i,li,p
[class|id|style|align],h1,h2,h3[style|align],h4,h5,h6,span[class],textformat[blockindent|indent|
leading|leftmargin|rightmargin|tabstops],u,table[width,style,height,cellspacing,border,cellpadding],
tr[valign,align,width,height,rowspan],td[valign,align,width,height,colspan,rowspan],div[class|id|
style|align],ul[id|class],iframe[width,height,frameborder,scrolling,marginheight,marginwidth,src,style]');

(i have had to put line breaks in to show the code fully...)

However the CMS when inputting HTML direct strips out all the table attributes, so I cant even set the width of a table now!

Any ideas? Thanks,

Avatar
lozhowlett

22 February 2011 at 12:33am Community Member, 146 Posts

Also within page.ss in my template I have...

function slideSwitch() {
var $active = $('#slideshowheader IMG.active');

if ( $active.length == 0 ) $active = $('#slideshowheader IMG:last');

var $next = $active.next().length ? $active.next()
: $('#slideshowheader IMG:first');

$active.addClass('last-active');

$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});

which gets replaced with...

function slideSwitch() {
var = $('#slideshowheader IMG.active');

if ( == 0 ) = $('#slideshowheader IMG:last');

var = ().length ? ()
: $('#slideshowheader IMG:first');

;

.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
;
});
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});

Stripping out all the variable names? Very odd!

Avatar
lozhowlett

22 February 2011 at 12:36am Community Member, 146 Posts

ok - JS problem solved by putting it in an external file.... however still the rich text editor issue. thanks,