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

HTMLText reformatting and breaking code




20 December 2010 at 3:47pm Community Member, 46 Posts


I have set up an HTMLText data-type field on a dataobject to hold the embed code for an mp3 player, see example below

<object data="" type="text/html" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="355"><param name="movie" value=""><param name="quality" value="high"><param name="allowNetworking" value="always"><param name="wmode" value="transparent"><param name="bgcolor" value="#FFFFFF"><param name="allowScriptAccess" value="never"><object data="" type="text/html" width="300" height="355"></object></object>

The problem is... the HTMLText data-type strips the closing </object> tag off the end upon saving. I'm guessing it thinks it's a mistake and wants to fix it for me... but it actually breaks the site in IE if i don't have that closing tag and also invalidates my mark-up.

I tried using the "Text" data-type instead of "HTMLText" but then it just spits out the code in text, not a rendered mp3 player.

Is there a way I can tell HTMLText data-type NOT to modify the code? Or a way to make Text data-type spit out the player rather than the code?

Thanks in advance :)