Embed youtube

EMBEDDING YOU TUBE VIDEOS IN DRUPAL WEBSITE

SEO
0  0 2015-12-21 08:35:24

Video Embed Field: defines a custom field type that allows you to display videos from YouTube or Vimeo. Not only can you embed videos; but you can also display video thumbnails.

The module also allows you to define video styles, just think of a video style as a video player. This means you can define a video style which is 640px wide on the article page, and then on the homepage define another style which is 320px wide.

Add Video Field to Content Type

The first step is to attach a video field to the article content type. When an editor needs to embed a video to an article, they will simply copy and paste the URL into this field.

1. Go to Structure, "Content types" and click on "manage fields" within the Article row.

2. Create a video field using the values defined in Table

Option

Value

Label

video

Machine name

Field _video

Field type

video Embed

Widget

video

3. Leave the field settings as default and click on "Save settings".

4. Now go to Content, "Add content" and Article.

Fill out the form and enter in a YouTube video into the video field.

Once the form is saved, you'll see an embedded YouTube player.

DISPLAY VIDEO THUMBNAIL USING VIEWS

One of the biggest benefits to using this module is the ability to display a video thumbnail. In this section, we'll create a block using Views that will list the recent articles and display a thumbnail for each article.

1. Go to Structure, Views and click on "Add new view".

2. Fill out the "Add new view" form, using the values defined in Table and click on "Continue & edit".

Option

Value

View Name

Recent Articles

Machine name

Recent articles

show

Content of type article sorted by newest first

Create a page

unchecked

Create a block

checked

3. Click on the Add link in the Fields section, select "Content: Video" and click on Apply.

4. Select "Thumbnail Preview" from the Formatter drop-down list, and then select a specific image style and where the thumbnail should link to.

 Now if you view the block in the preview area, you'll see a video thumbnail below the title.

 Finally, change the field order so that the title is below the thumbnail.

Now we need to go to the Blocks page and add the view block to a region. So go to Structure, Blocks and add the view      into a specific region.

Once you configure the block, go to the homepage and you should see the block in the specified region.

 

Comments (0)

Post Your Comments

Headquarter



Hong Kong Office



Find Us On

Website Development Company
SEO
Digital Marketing
website development company in Hong Kong
website designer in pune