Main menu

drupal 7

How To: Implement Start and End date fields using regular Drupal 7 Form API

Published by dnovikov on Fri, 10/03/2014 - 15:51

Drupal Date module allows creation of so called "combo" fields in content types, which means you get a combo of "Start date" and "End  date" fields. But what if you want to implement this behavior in your arbitrary form? Well, create two normal "date_popup" fields:


How to: Integrate Youtube IFrame API and Youtube field in Drupal 7

Published by dnovikov on Wed, 09/03/2014 - 12:20

If you are using Youtube module to display videos at your site, you may want to add some reactions on the Youtube player events. For instance, I did so for Google Analytics tracking capabilities.

To enable usage of the Youtube IFrame API, you need to add some Javascript code. Please remember: do not put it in Drupal behaviors wrapper!

The code is like this:

// Load YouTube IFrame API.
var tag = document.createElement('script');