Jump to:

4875 Posts in 6997 Topics by 1472 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » HTML editor changes my code

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

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

Page: 1 2
Go to End
Author Topic: 4901 Views
  • electricbadger
    Avatar
    Community Member
    2 Posts

    HTML editor changes my code Link to this post

    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!

  • electricbadger
    Avatar
    Community Member
    2 Posts

    Re: HTML editor changes my code Link to this post

    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://ondemand.port.ac.uk/central/One_way_to_write_an_essay.wmv">
    <embed type="application/x-mplayer2" width="514" height="357" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="mms://ondemand.port.ac.uk/central/One_way_to_write_an_essay.wmv" 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="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="514" height="357"><param name="movie" value="mms://ondemand.port.ac.uk/central/One_way_to_write_an_essay.wmv" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="mms://ondemand.port.ac.uk/central/One_way_to_write_an_essay.wmv" wmode="transparent" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" 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!!!

  • UncleCheese
    Avatar
    4085 Posts

    Re: HTML editor changes my code Link to this post

    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.

  • CriaturaCreativaStudio
    Avatar
    Community Member
    73 Posts

    Re: HTML editor changes my code Link to this post

    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.

    Regards

    Eduardo

  • shapeg
    Avatar
    Community Member
    4 Posts

    Re: HTML editor changes my code Link to this post

    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?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: HTML editor changes my code Link to this post

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

  • borriej
    Avatar
    Community Member
    267 Posts

    Re: HTML editor changes my code Link to this post

    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">

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: HTML editor changes my code Link to this post

    Try this in your _config.php:

    HtmlEditorConfig::get('cms')->setOption('cleanup_callback','');

    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.

    4901 Views
Page: 1 2
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.