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.

Installing SilverStripe

Getting SilverStripe up and running on your computer and on your web server.

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

HTML editor changes my code

Go to End

10 Posts   5124 Views


25 January 2009 at 8:29am Community Member, 2 Posts

Is is possible to stop the HTML editor changing my code?

I have edited TinyMCE to let it allow all tags. But the way it changes the code I enter is causing all sorts of problems when I want to do things like insert videos or Flash.

Appart from that Silver Stripe looks great. But this problem is driving me crazy and could be something that would make me chose another CMS!


25 January 2009 at 8:44am Community Member, 2 Posts

Ok - this is REALLY driving me crazy now!!

I inserted the following code to embed a .wmv file (hosted on a seperate stream server)....

<object id="StreamWM" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="514" height="357"><param name="autoStart" value="0">
<param name="autoSize" value="0">
<param name="ShowGoToBar" value="1">
<param name="StatusBar" value="1">
<param name="DisplayMode" value="1">
<param name="DisplaySize" value="1">
<param name="windowlessVideo" value="true">
<param name="wmode" value="transparent">
<param name="URL" value=" mms://">
<embed type="application/x-mplayer2" width="514" height="357" pluginspage="" src="mms://" autosize="1" autostart="0" animationatstart="0" displaymode="1" showcontrols="1" showdisplay="0" showstatusbar="1" showtracker="1" TransparentAtStart="1" windowlessVideo=" true"></embed></object>

But SliverStripe changed it to this...
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,29,0" width="514" height="357"><param name="movie" value="mms://" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="mms://" wmode="transparent" quality="high" menu="false" pluginspage="" type="application/x-shockwave-flash" width="514" height="357"></embed></object>

Which clearly wont work becuase it is a Windows - not a Flash video!!!

What am I missing??? How can I stop the code I insert being changed? There MUST be a way!!!


25 January 2009 at 1:11pm 4085 Posts

Seems like a pretty complex chunk of code to be trying to jam into the WYSIWYG editor. Stick to the basic headers, paragaphs, unordered lists, etc, and put stuff like that in the template. It really doesn't belong in the editor. That's not really what it's for. Even if it did work, you're running the risk of some frustrated client accidentally blowing the whole thing away or removing part of it.

Just thinking about it gives me a headache. Make a new template with the SWF attached to the page as a related object. Much cleaner.


29 March 2009 at 8:35am Community Member, 73 Posts

I think editor or silverstripe definittely alters the code...
I've styled tags and classes on a css file to appear the way i like it.
The code i enter on the editor begins with an IMG tag... but silverstripe insists to add a <p> tag surrounding the <img> tag, and i don't want that. Can i turn off that feature? because i don't want my code to be changed, i already take care that my code looks good.




22 September 2009 at 6:57am Community Member, 4 Posts

I am just wanting to add a simple "rel"='lighthouse' takg to the "<AREA...." code and have updated tiny_mce.js but it still won't let me. Keeps removing it. It allows the tag after a <A ...... Any ideas?


22 September 2009 at 7:51am (Last edited: 22 September 2009 7:51am), Community Member, 901 Posts

According to standards, the rel attribute isn't allowed on elements other than <a> and <link>. That's probably why it gets stripped from your code...


4 August 2010 at 1:52am Community Member, 267 Posts

Has this been solved yet?

i also want to add some html that gets changed :(

simple javascript on a div:

<div id="item_pic1" OnClick="javascript: window.location = 'url....';" style="cursor: pointer">


4 August 2010 at 1:59pm Community Member, 181 Posts

Try this in your _config.php:


That will remove the sapphiremce_cleanup function that removes all on* events, it also does more so you might want to take a look and decide if you'll miss any of that. I usually recommend creating a new "HTML Editor Configuration" for power users and leave the default "cms" config in tact.

Go to Top