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.

Archive /

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

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

Silverstripe stripping out youtube flash objects?

Go to End

9 Posts   5953 Views


Community Member, 1 Post

24 February 2007 at 10:54pm

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

I've been trying to embed a youtube video into a page with little success
I'm trying to get the following markup to show through:
"<object width="425" height="350"><param name="movie" value=""></param><param name="wmode" value="transparent"></param><embed src="" 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="">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.



Community Member, 11 Posts

1 March 2007 at 3:48am

Edited: 01/03/2007 3:50am

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


126 Posts

15 December 2007 at 1:04pm

Edited: 15/12/2007 1:05pm


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,


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.



Community Member, 501 Posts

18 December 2007 at 9:50am

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?



Community Member, 201 Posts

18 December 2007 at 12:17pm

A simple solution is just to create a separate 'HTMLText' field, and paste the embed code in it. This was done for another site and it worked well for that.


Community Member, 501 Posts

18 December 2007 at 12:29pm

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.


Community Member, 40 Posts

24 November 2008 at 4:50pm

how would you create it for the blog? Thanks


Community Member, 5 Posts

1 December 2008 at 10:14am

Edited: 01/12/2008 10:16am

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.

Go to Top