Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Problem with CMS stripping out code...

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

Page: 1
Go to End
Author Topic: 700 Views
  • lozhowlett
    Avatar
    Community Member
    146 Posts

    Problem with CMS stripping out code... Link to this post

    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,

  • lozhowlett
    Avatar
    Community Member
    146 Posts

    Re: Problem with CMS stripping out code... Link to this post

    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!

  • lozhowlett
    Avatar
    Community Member
    146 Posts

    Re: Problem with CMS stripping out code... Link to this post

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

    700 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.