YouTube Sidebar Widget

Posted on Jun 14, 2011 in Plugins | 0 comments

Plugin Purpose

Screenshot of the YouTube Sidebar Widget
The YouTube Sidebar Widget is a simple tool, but works great for showing a list of videos from a YouTube user or a playlist.

Why would you want to do that? Most commonly, to show a list of videos representing your business on your website.

Advantages

I prefer it to plugins such as Smart YouTube and TubePress for these reasons:

  • YouTube Sidebar Widget works with Conditional Widgets, which is useful if you want to show different lists of videos on different pages.
  • This widget is, I feel, more intuitive for clients. They can just rearrange the playlist in their YouTube account and have their website reflect the changes instead of having to copy URLs over to WordPress.
  • Easy to pick how many videos you want to show.
  • Instead of embedding the video player, it shows a thumbnail image that, when clicked, opens a pop-over with the video in it. The thumbnails load faster and more reliably; they can show on smartphones and behind corporate firewalls where the actual video itself may not be able to be played.
  • Unlike similar widgets, you can add the widget to multiple sidebars, which is useful if you use conditional logic or otherwise have different sidebars on different sections of your site.

Disadvantages

  • The YouTube Sidebar Widget is very simple. You can load videos from a playlist or a user; you can choose how many to show, and that’s pretty much it. You can’t change the order of videos, use videos from other sites, or even easily change the size of the thumbnails.
  • You may see an error message if your server isn’t configured correctly. See the Troubleshooting section below.
  • The thumbnails may be too large for your theme.
  • Your theme may add in list bullets.

Troubleshooting

Admittedly, the YouTube Sidebar Widget has a few quirks–but here are some solutions I’ve found.

Why are There List Bullets Beside Each Thumbnail?

This is your theme’s fault–although, admittedly, the plugin creators could have prepared CSS for this event. Typically this happens when your theme specified a background image for list items in the sidebar. Try this CSS:

#youtube-sidebar-widget ul li {
background:none;
padding-left:0;
}

This eliminates a background image for the list items and any padding the theme may have added. The padding-left may be unnecessary, or you may need to change margin-left instead.

How Do I Change the Thumbnail Size of the Videos?

Mainly, just fiddle around with CSS until it looks right. The tricky part is lining up the thumbnail, play arrow and video title correctly, which mainly takes trial and error depending on the size of your sidebar.

Here’s a passable (FAR from perfect) way to make the thumbnails substantially smaller:

#youtube-sidebar-widget ul li img {
width:120px;
height:90px;
}

#youtube-sidebar-widget ul li div.play_arrow {
margin-top:-95px!important;
margin-left:10px!important;
}

#youtube-sidebar-widget ul li a {
text-align:left;
}

Honestly, it’s probably easier to just remove the play button completely than it is to get it lined up properly. See below.

How Do I Hide the Play Arrow?

The image showing the play button over each video thumbnail can be a bit quirky, location-wise. If you have trouble with it, just remove it, like so:

#youtube-sidebar-widget ul li div.play_arrow {
display:none;
}

Instead of Video Thumbnails, I Just Get an Error Message!

I ran into this problem with the widget myself. Through trial and error, I was able to figure it out: allow_url_fopen was off in my php.ini.

If your php.ini has “display_errors” turned off, all you will see is “Service unavailable” where the widget is supposed to appear on the page.

If “display_errors” is turned on, you see something like this:

Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in /home/mysite/public_html/wp-content/plugins/youtube-sidebar-widget/youtube-sidebar-widget.php on line 100

Warning: simplexml_load_file(http://gdata.youtube.com/feeds/api/playlists/17735FFE917E0061?v=2) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /home/mysite/public_html/wp-content/plugins/youtube-sidebar-widget/youtube-sidebar-widget.php on line 100

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/playlists/17735FFE917E0061?v=2" in /home/mysite/public_html/wp-content/plugins/youtube-sidebar-widget/youtube-sidebar-widget.php on line 100
Service Unavailable.

Hopefully the plugin authors will change what the widget uses, as some web hosts have “allow_url_fopen” set to “off” by default. If you see messages like this, talk to your web host tech support and see if they can help you with these settings.

Submit a Comment

Manage your comment subscriptions