Embedding Youtube Videos - what class attribute?

Author Message

Matthew Knight

Monday 27 October 2008 9:24:23 am

I'm relatively new to EZ, and still getting my head around the platform, so I'm probably being absolutely stupid - but what class attribute would you use if you wanted to allow CMS editors to copy and paste in embed tags, such as youtube videos?

Andrew Duck

Monday 27 October 2008 12:15:16 pm

Hi Matthew,

Well you could do that with a text block, but I suspect there is probably a tidier solution to embedding Youtube videos.

You could use a URL attribute and just paste the url, then have your templates wrap the url in the appropriate embed tags.

There is a youtube extension available from either http://ez.no/developer/contribs or http://projects.ez.no which allows the embedding of Youtube videos.

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

John Moritz

Monday 27 October 2008 12:35:54 pm

I would do it like Andrew said. Use an URL attribute and just save the URL.
Then you are able to make changes on the embed code.
Maybe give them a choice, to save the url, the Video-ID or the embed code. Saving the Video-ID only would be the best solution, but thats maybe to difficult (not realy but i have seen a lot of weird things...) for some unexperienced internet Users.

As example, you are allowed to choose the size of the youtube player. If you use the embed code, you have to hack the embed code to resize the player on different views. Maybe today you think the width should be 500 px, tomorrow it should be 350 px. If you save the URL you can extract the Video-ID and generate the embed code dynamicly.

This will work on the most Video network Sites i know. There are also a lot of APIĀ“s for youtube and other Sites. Google is your friend.

Matthew Knight

Thursday 30 October 2008 11:02:45 am

thanks for the thoughts - youtube was just one example, there are lots of different embeddable pieces of content which we'd want to support, so it needs to ideally just be the raw HTML. i've found a solution over in another thread about defining a block which you can past raw HTML into:

http://ez.no/developer/forum/setup_design/youtube_object

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.