Forums / Setup & design / Embedding Youtube Videos - what class attribute?

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

eZ debug

Timing: Jan 18 2025 21:05:16
Script start
Timing: Jan 18 2025 21:05:16
Module start 'content'
Timing: Jan 18 2025 21:05:17
Module end 'content'
Timing: Jan 18 2025 21:05:17
Script end

Main resources:

Total runtime0.8860 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.8438180.8125
Module start 'content' 0.00620.7473 768.6563583.2266
Module end 'content' 0.75340.1325 1,351.8828337.3672
Script end 0.8860  1,689.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4675210.0002
Check MTime0.00160.1809210.0001
Mysql Total
Database connection0.00080.089510.0008
Mysqli_queries0.802890.60901990.0040
Looping result0.00210.23991970.0000
Template Total0.858496.920.4292
Template load0.00220.247520.0011
Template processing0.856296.628820.4281
Template load and register function0.00020.022110.0002
states
state_id_array0.00140.160310.0014
state_identifier_array0.00100.116920.0005
Override
Cache load0.00180.2085190.0001
Sytem overhead
Fetch class attribute can translate value0.00140.155340.0003
Fetch class attribute name0.00120.132550.0002
XML
Image XML parsing0.00100.117240.0003
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00680.7719290.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs