If you have ever copied the embed code for a video, such as those provided by YouTube, and tried to paste it into your Drupal post, you may have found that your video does not even show up in your post. This article describes how you can correctly insert a video from a video sharing site into a Drupal article or post.
The first step is of course to upload your video to a video sharing site, and get the embed code that they supply to you. The embed code typically looks something like this:
<object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/tIBxavsiHzM" /> <embed src="http://www.youtube.com/v/tIBxavsiHzM" type="application/x-shockwave-flash" width="425" height="350" /> </object>
For the curious, the above code comes from thesitewizard.com's feedback form script How-To video. In YouTube, you can find the code to embed your video in the box labelled "Embed" on your video page. The other video sharing sites also provide easy-to-use cut and paste code for your videos.
Log into your Drupal account, go to your "Create content" section, followed by "Blog entry" or whatever entry type that you are using. Give your post appropriate titles and content. It's best to say something, even if it's very brief, about what the video is about in the main body. The importance of this is explained in my article on creating search engine friendly websites at http://www.thesitewizard.com/sitepromotion/search-engine-friendly.shtml
Hit the ENTER (or RETURN) key a couple of times after your paragraph. Paste the embed code.
Under the post box is a link called "Input format". Click it to expand the section. By default, the "Filtered HTML" button is enabled. This option only allows a limited set of HTML code to be used in your Post box. Since the embed code is not in the list of allowed HTML code, Drupal will filter your code when it displays your post, resulting in your video not appearing when your article is viewed.
Select the "Full HTML" radio box instead.
When you've finished with your post and the post settings, click the Submit button. Your video should now appear correctly in your Drupal blog.
Do you find this article useful? You can learn of new articles and scripts that are published on thesitewizard.com by subscribing to the RSS feed. Simply point your RSS feed reader or a browser that supports RSS feeds at http://www.thesitewizard.com/thesitewizard.xml. You can read more about how to subscribe to RSS site feeds from my RSS FAQ.
This article is copyrighted. Please do not reproduce this article in whole or part, in any form, without obtaining my written permission.
It will appear on your page as: