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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

rich text edit messing my code!


Go to End


2 Posts   2032 Views

Avatar
lozhowlett

Community Member, 151 Posts

15 January 2010 at 12:17am

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

Community Member, 10 Posts

15 January 2010 at 2:58am

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