Last updated 13 August 2012. Created on 16 May 2007.
Edited by mguillau, larowlan, stella. Log in to edit this page.

Demo site:

There are a number of ways to use Lightbox2 functionality and they can be split into two sections - manual and automatic.


The majority of the links at the bottom of this page provide details on how to add custom links to your site which when clicked will open an image, video or web page in a lightbox. This is done through the use of a rel attribute on the anchor link.

For example to open an image in a lightbox by clicking on a link, you would type something like the following:

<a href="images/image-1.jpg" rel="lightbox" title="my caption">click here!</a>

The rel type can be one of the following:

  • lightbox for image content
  • lightshow for image slideshows
  • lightvideo for video content
  • lightmodal for inline HTML content. Note this isn't for full web pages, just snippets of HTML content
  • lightframe for everything else, including external web pages.

Each rel type supports different types of content and features. See the links below (particularly How to add inline content) for more details regarding additional configuration options available to control how your lightbox displays.


Lightbox2 integrates with a lot of Drupal modules to automatically add Lightbox2 support. This means there is no need to add rel="lightbox" to each individual image on your site. The enabling of lightbox support for a particular Drupal module can be easily enabled and configured at admin/settings/lightbox2/automatic. Details on these configuration options can be found at Lightbox2 - Settings.

CCK imagefield, emfield and filefield are the exception to this - the lightbox functionality for these modules can be enabled per CCK field in your View or custom content type.

The list of modules supported include:

Other modules also provide support for Lightbox2, including Imagefield Gallery and Fast Gallery. Gallery2 support is available, see link below.

Looking for support? Visit the forums, or join #drupal-support in IRC.