This page last changed on Aug 17, 2012 by yuriy.kalynovskiy@involver.com.
Overview
Provides the ability to display videos from a specified YouTube channel or user.

Configuration
Configuration of the YouTube for Pages SML feature is very straightforward. The only required field is the "YouTube User / Channel Name". This tells the feature where to pull videos from. There are a few other options to bring in your Uploads/Favorites/Playlist. Note: When you check the option for "Import A Playlist" the system will import all public playlists which can vary when compared to the actual public playlists that are being displayed on the YouTube channel.

Caching Considerations
This feature block has no caching considerations.
Attributes
name |
type |
required |
description |
name |
string |
false |
This is a name to identify the specific feature instance that you are using in your template code. This is useful if you have multiple instances of the same feature on the same page. Note: By default, the SML will look for a nick name of "default" if you do not specify one in the tag definition. |
Context Variables
name |
type |
description |
you_tube_feed.you_tube_items |
Array of you_tube_item elements |
Returns a collection of you_tube_items you can use to display on the page. This can be paginated with pagination options below. |
you_tube_feed*.featured_item* |
you_tube_item |
Returns the featured video. |
you_tube_feed*.number_of_videos* |
int |
Returns the total number of videos available for display. |
you_tube_feed*.video_sort_order* |
string |
Returns the default order in which the videos are returned on pagination. |
you_tube_feed*.max_videos_to_show* |
int |
Returns the maximum number of videos returned for pagination. |
you_tube_feed.videos_per_page |
int |
Returns the number of videos to display per page. The default is 6. This can be set by configuring the feature. |
you_tube_feed.rows_per_page |
int |
Returns number of rows to display per page. |
you_tube_feed.import_videos_by_user |
boolean |
Returns true if you are importing user uploaded videos. |
you_tube_feed.import_favorites_of_user |
boolean |
Returns true if you are importing the favorites of a user. |
you_tube_feed.import_playlist_of_user |
boolean |
Returns true if you are importing a playlist. |
you_tube_feed.selected_playlist_id |
string |
Returns the youtube playlist id of the selected playlist. |
you_tube_feed.row_size |
int |
Returns number of videos displayed per row. |
you_tube_feed.page_count |
int |
Returns page count. |
you_tube_feed.user |
string |
Returns youtube user. |
you_tube_feed.channel_url |
string |
Returns url of youtube channel. |
you_tube_feed.get_playlist_name |
string |
Returns play list name you are importing. |
you_tube_feed.get_playlist_video_count |
int |
Returns number of videos in playlist you are importing. |
you_tube_feed.tubemogul_enabled? |
boolean |
Returns true if you are using tubemogul for youtube reporting/statistics. |
Examples
Simple Example
Renders default template.
{% you_tube_feed %}{% endyou_tube_feed %}
Custom Code Example
Use the ?youtube_video_embed tag to embed youtube videos. This tag will embed an html5 video on devices that suport it and a flash video on other devices. This will ensure your videos display correctly on mobile devices.
{% you_tube_feed %}
<div class="player-wrapper">{% youtube_video_embed you_tube_feed.featured_item width:"300" height:"300" autoplay:false %} </div>
<h3>{{ you_tube_feed.featured_item.title }}</h3>
{% endyou_tube_feed %}
Single Video with facebook_like associated
NOTE: This method can also be used with content_vote and share
{% you_tube_feed name:"custom" %}{% for item in you_tube_feed.you_tube_items limit:1 %}
<div class="video-wrapper">{% youtube_video_embed item width:240 height:130 %}
</div>
<p>{% facebook_like item %}</p>{% endfor %}
{% endyou_tube_feed %}
FAQ
Q: How do I embed a single specific video?
A: Use the flash_embed tag instead: http://developers.involver.com:8080/display/IDN/flash_embed
Related Topics
|