Page 1 of 1

embedding video code

Posted: Sat Aug 14, 2010 5:28 pm
by rj
As a blog that does video embedding as a way of life now for some years, I have experienced many code issues, to say the least.

The biggest of which is that WYSWYG editors alter most JS code after that first SAVE. We are OKAY if we do not SAVE it again, or TWICE. Video content companies like YOUTUBE and Comedy Central somehow compensate for this problem, and even though you can see the code has changed it still works, though you will never get a W3 rating! :)

What most often happens is the last </embed> gets stripped which cause IE to go bonkers. This is presently the case with MSNBC which recently changed their embed code from the old simple <iFrame> To <object><embed>

If any of my writers who all use WYSWYG SAVE as a draft or go back later to edit and save again, the changed code does very bad things to our visitors who use IE. One can only save ONCE, that first time without it going bad.

I searched the issue recently and found it to be a rather big issue over at WORDPRESS, they have a plugin that uses the words "custom fields" and "value fields" which fixes the problem. I assume it holds the JS code inside a field box without disrupting it. One then puts "fieldbox1" or something in the editor where it slaps it in and it doesnt make a mess of things.

So out of the box so to say, can this work with our CUSTOM FIELDS down there, and how exactly is that done. Easily for Dummies! :)

This is also an issue with Adsense. If you save a nugget with it in TWICE it often goes bad.

Re: embedding video code

Posted: Sun Aug 15, 2010 7:12 pm
by Don Chambers
If the issue exists with the wysiwyg editor only, have you considered not using that particular editor, or at least disabling it in your personal settings long enough to edit the entry and nugget?

Having said that, it would be quite simple to create an extended property field to hold the enbed code. The only real issue would be deciding where in your entry you would want that to appear.

Re: embedding video code

Posted: Mon Aug 16, 2010 12:52 am
by rj
Not using the WYS editor is out of the question. :)
So does this extention have to do with those 3 FIELD boxes below the editor. THis has to be very simple for my help to use. Something like... Hey gals, what you need to do is paste that code stuff in this palce and than type "whatsit" where you want it to go. Anything more complicated than that is wishing on stars... :)
Thanx and lead me in the right direction if you think it possible..

Re: embedding video code

Posted: Mon Aug 16, 2010 10:00 pm
by Don Chambers
I think you would need a plugin that could detect a tag you inserted into an entry and replace it with the contents of an extended property field *IF* you needed the ability for the video to appear at varying places in different entries.

If the video was always going to appear at the same place in an entry, it would be quite simple.

Lets say you named one of your custom entry property fields "video". You could put this in your entries.tpl file where you wanted the embed code to display:

Code: Select all

{if $entry.properties.ep_video}{$entry.properties.ep_video}{/if}
You can get much fancier than that - put it in a div, float it left or right, etc....