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   770 Views

Avatar
lozhowlett

Community Member, 146 Posts

22 February 2011 at 12:20am

Edited: 22/02/2011 12:21am

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

Community Member, 146 Posts

22 February 2011 at 12:33am

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

Community Member, 146 Posts

22 February 2011 at 12:36am

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