Tag Archives: LightBox2

Drupal 7 – Show YouTube video in LightBox2

The following HTML allows you to show a video in LightBox2.

<a href="http://www.youtube.com/embed/<VIDEO ID>?autoplay=1" rel="lightframe">Click me</a>


We could control the size of the popup.

<a href="http://www.youtube.com/embed/<VIDEO ID>?autoplay=1" rel="lightframe[|width:320px; height:240px;]">Click me</a>


Done =)


Drupal 7 – Add extra text on the LightBox2 popup

Update @ 2014-01-24: Instead of hacking into LightBox2 module, you can use the hook_js_alter() as suggested by Sunny Gambino. Thanks Sunng. =D


LightBox2 will show the image title as caption in the popup.

But apart from the title, i would like to add extra text to the popup. Unfortunately there is no proper way to do it. So i have to hack into the lightbox.js.
Continue reading Drupal 7 – Add extra text on the LightBox2 popup