Following on from my previous post ‘Getting thumbnails using the Vimeo API in PHP’ I thought I’d take a look at what solutions are available for those people using a CMS, firstly Drupal.
The module on the Drupal projects site isn’t an official one – however it is very useful and I’ll go through what you need to do to get it working. First you’ll need to download the module and add it to your sites/all/modules/contrib folder and enable it through the back end. The module relies on the following modules also being installed – so you may have to get them too:
Once you’ve installed all of these you can go about configuring the module. If you’re using the admin menu you can go to Site Configuration > Vimeo. Once you’re there you can see all your usual Vimeo settings that deal with the display, but we won’t focus on them for now, we’ll look at how to get a Vimeo video in your content!
In ‘Add New Source’ you can add a Vimeo source by user, album, group or channel. In this instance I’m going to use my user, which you can find by logging into Vimeo, and clicking on ‘Me’.
This is where many people will come across a problem. You might well see the following error:
Fatal error: Call to undefined function curl_init() in C:\wamp\www\blankdrupal6\sites\all\modules\custom\vimeo\vimeo.module on line 467
If so, this isn’t a missing module, or a problem with Drupal, all it means is you need to enable the PHP extension ‘php_curl’. If you can’t do this you might need to ask your host provider if this is possible. Once you’ve done this, try and again – and all should be well.
Now when you move over to the ‘Vimeo Source List’ you should see your name there.
Now to add it to some content! I want to add a Vimeo video to the default Page content type, so I’m going to go to Content Type > Edit Page > Manage Fields. I’m going to add a new field with the label ‘Vimeo’ and the field name ‘field_vimeo’, and the type is nice and simple, ‘Vimeo’. Saving the field will give you a standard Drupal field page, where you can make the field required or set its number of values.
Now when I go to create a Page, I can see the Vimeo field, clicking on ‘Browse’ should bring me up a nice pop up showing me all the video’s I have on Vimeo, and clicking on one of them will add it to the content.
Now when I save the content, I can see that I have a nice Vimeo video embedded in my content! This embed is a little bit wide, so I’m going to go back and make some alterations to the video in the Vimeo configuration section we looked at earlier.
And there you have it! Sadly there is no Vimeo module for Drupal7 just yet, but if I hear anything about one, I’ll make additions to this post as appropriate!
- Log in to post comments