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

rich text edit messing my code!


Reply

2 Posts   1310 Views

Avatar
lozhowlett

15 January 2010 at 12:17am Community Member, 146 Posts

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

Avatar
karlevid

15 January 2010 at 2:58am Community Member, 10 Posts

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