Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » rich text edit messing my 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: 1233 Views
  • lozhowlett
    Avatar
    Community Member
    140 Posts

    rich text edit messing my code! Link to this post

    Hi guys,

    I am trying to paste some code in, but the wysiwyg editor keeps messing with it! Here is the code I am inputting...

    <ul id="mycarousel" class="jcarousel-skin-tango">
       
    <li><div style="width:470px; float:left; background-image:url(images/photobar/photoHolder.png); background-repeat:no-repeat;height:260px">
    <img src="images/photobar/trailer1.jpg" style="margin-left:54px; margin-top:7px" />
    </div>
    <div style="width:300px; float:left; margin-top:10px;"><h3 style="color:#FFFFFF; margin-bottom:5px; font-size:16px;">The Demountable Kiosk</h3><p>A kiosk is perfect for a user who wishes to trade from one place of work that may only have to be moved occasionally so you do not have to pay for all the axles and couplings un-necessarily, however the benefits of buying a 4 Sure Kiosk means you can also use a kiosk for many different functions.</p>
    <p style="margin-left:75px;"><img src="images/photobar/btn-moreInfo.png" /></p>
    </div></li>
    </ul>

    and this is what keps pumped out after i save...

    <ul class="jcarousel-skin-tango">
    <li>
    <div style="width: 470px; float: left; background-image: url(images/photobar/photoHolder.png); background-repeat: no-repeat; height: 260px;"><img src="images/photobar/trailer1.jpg" /></div>
    <div style="width: 300px; float: left; margin-top: 10px;">
    <h3 style="color:#FFFFFF; margin-bottom:5px; font-size:16px;">The Demountable Kiosk</h3>
    <p>A kiosk is perfect for a user who wishes to trade from one place of work that may only have to be moved occasionally so you do not have to pay for all the axles and couplings un-necessarily, however the benefits of buying a 4 Sure Kiosk means you can also use a kiosk for many different functions.</p>
    <blockquote>
    <p><img src="images/photobar/btn-moreInfo.png" /></p>
    </blockquote>
    </div>
    </li>
    </ul>

    As you can see its deleted the ID tag, which i need to fire the JS up! Any ideas would be great!

    Thanks

  • karlevid
    Avatar
    Community Member
    10 Posts

    Re: rich text edit messing my code! Link to this post

    in your "_config.php" can can define the tags that you want to allow.

    example:
    HtmlEditorConfig::get('cms')->setOption('valid_elements', 'a[href|target|rel|class],b,br,font,img[src|id|width|height|align|hspace|vspace,KeepThis,true,TB_iframe],i,li,p,h1,h2,h3,h4,h5,h6,span[class],textformat[blockindent|indent|leading|leftmargin|rightmargin|tabstops],u,table,tr,td');

    read: http://silverstripe.org/general-questions/show/272653#post272653

    1233 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.