Create a video carousel: Feed API + Emfield + Views Carousel

January 29
blog author

Appno Blogger

Appnovation Coop

Recently, I had to create a carousel with YouTube videos (thumbnails). I downloaded and enabled 'emfield', 'emthumb', 'emvideo', 'viewscarousel' and 'jcarousel' modules. I created a new content type - youtube_video - with a field field_youtube_video of "Embedded Video" type. Now I had to create a view. In a new view's Basic Settings, I set Style to Views Carousel and added Fields -" Content: Youtube Image Thumbnail (linked to node)" and "Node: Title". I also set Filters to "Node: Type = Youtube Video".

You will also want to modify some settings to make it look as you like, but this is pretty much everything that you need to create a carousel - just add some nodes and enter the URLs to a YouTube pages of video you want to display. But I needed more than that - I needed YouYube_video nodes to be created for me from this RSS.

I did some research and I found a very handy screencast - Feed API + Emfield Screencast - which explained step-by-step exactly what I needed. It showed how to use FeedAPI module to create a custom node. This looked really promising, so I went to the FeedsAPI project page going to download it and found out that "The maintainers of FeedAPI launched a successor project: Feeds" and most probably it will not be supported in Drupal 7. So, I wanted to try this one instead.

The Feeds module looked "as advertised" - very easy to use. It also had quite reasonable default settings (I enabled feeds_defaults module). I had only one problem - I could not make it work with emfields - they were not in the list of mapping fields. I checked the code and found out that a CCK field type can be only 'text', 'number_integer' or 'number_decimal'. This was a show stopper. I guess that there is a way of fixing this by implementing some kind of hook_feeds_node_processor_targets_alter() for the emfield, but this is something yet to be done. For now, I turned back to the FeedAPI module and this combination works like charm.