Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Silverstripe stripping out youtube flash objects?

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 5141 Views
  • jujhar
    Avatar
    Community Member
    1 Post

    Silverstripe stripping out youtube flash objects? Link to this post

    Does silverstripe strip out <object></object> tags?

    I've been trying to embed a youtube video into a page with little success
    see http://ramnarayan.org/piloo/
    I'm trying to get the following markup to show through:
    "<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/1fF8WtguWgY"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/pdelp1Pr0tQ" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>"

    but instead silverstripe chucks out:
    " <em><strong>ERROR:</strong> If you can see this, then <a href="http://www.youtube.com/">YouTube</a> is down or you don't have Flash installed.</em> "

    I've even stuck it straight into the 'Sitetree' table record for that page using phpMySQL just in case it was TinyMCE that was causing the problem.

    The object tags are in the database record, but silverstripe refuses to let that HTML pass through it's renderer.

    Any ideas?

    Otherwise a great job guys thanks.

    J

  • someonlinedude
    Avatar
    Community Member
    11 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    Sorry very busy so you have to google: Go to the tinymce website and look for valid elements in the wiki

    Try again if its not a cleanup feature of the tinymce, if you want to change that, you will have to edit the tinymce template file. ( /jsparty/tinymce/ )

    I had a similar problem, *

    • didnt work in SS

  • Anatol
    Avatar
    126 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    Hi,

    I also could not embed YouTube flash objects in the Silverstripe CMS TinyMCE editor (this is Silverstripe 2.2.0). I tried to enter the code from YouTube, but TinyMCE always changed the code, i.e. it removed the YouTube source URL and added other stuff like pluginspage, codebase, etc ...

    To embed Youtube videos with the HTML button in TinyMCE I simply edited the file /cms/javascript/tinymce.template.js and changed the line

    verify_html : true,

    to

    verify_html : false,

    TinyMCE still adds code, but it does not strip the source URL any more.

    I did not test if changing verify_html to false has some bad side-effects elsewhere, and also I did not have the chance to test the result on the published page on a system other than a Mac but I will post here if I discover that this causes some problems.

    The best solution would be a TinyMCE plugin to add a button for embedded video from external sources such as YouTube, Google Video, etc... There must be such a plugin out there, but I couldn't find a proper one yet.

    Cheers!
    Anatol

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    I'm really interested in a clean way of doing this.

    There must be some kind of plugin for this, no? Even the wordpress editor has a specific button for it.

    I think this is a must for a blog, and I'm already having someone asking to embed YouTube movies and finding them stripped.

    Have you found any side-effect of verify_html yet? I don't think I want to change this to false, as it probably doesn't correct html if it's screwed up by none-savvy users in htmlMode?

    grtz

  • Tim
    Avatar
    Core Development Team
    201 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    A simple solution is just to create a separate 'HTMLText' field, and paste the embed code in it. This was done for another site http://www.start-up.co.nz and it worked well for that.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    Yeah, agree.

    But wouldn't work in my situation though. It's some kind of blog and there should be the ability to embed the youtube anywhere in the text.

    Doing it your way would be a little too limiting I'm afraid.

  • itlinux
    Avatar
    Community Member
    40 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    how would you create it for the blog? Thanks

  • macsepp
    Avatar
    Community Member
    5 Posts

    Re: Silverstripe stripping out youtube flash objects? Link to this post

    Yes how about a workaround for the Blog?

    I followed the instruction to turn off the html verification but it only seems to work for the blog entry excerpt then. Not for the entry itself.

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