Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
This all started with a post on the DO forums asking "I was wondering if there are any modules that output the entire Drupal setup and document the modules and configurations." That got me started thinking... Very dangerous for a blonde!
Why Do I Need It?
Unfortunately Drupal does not include the powers of immortality or invincibility. You may someday get hit by a truck, or even just decide that you no longer want to maintain the site. So someone else may have to take over.
There are a number of ways to use Lightbox2 functionality and they can be split into two sections - manual and automatic.
Manual
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:
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.
The Lightbox2 module can be configured at Administer >> Site Configuration >> Lightbox2. Users will need the 'administer lightbox2' permission to alter the settings.
Not all of these options will be available depending on the module version you're using.
There are two permissions you can assign a user using the Lightbox2 module:
administer lightbox2 - enables users to modify the configuration settings on Administer >> Site Configuration >> Lightbox2.
download original image - allows users to the "download original" link in the lightbox for images uploaded by the image and imagefield modules. (6.x only)
Download the latest version of the Lightbox2 module from the project page. Untar/unzip the files and place the entire lightbox2 directory in an appropriate module directory like sites/all/modules.
The Lightbox2 module is a simple, unobtrusive script used to overlay images on the current page. It is easy to set-up and works on most modern browsers. The module places images above your current page, not within. This frees you from the constraints of layout, particularly column widths, and keeps users on the same page. Clicking to view an image and then having to click the back button to return to your site is bad for continuity (and no fun!). The module inserts the required JavaScript and CSS directly into your page with no need to edit the theme.
Features
The version 2 module has several benefits over the plain Lightbox module. Note, not all of these features are available when the "Lightbox2 Lite" option is enabled.
Image Sets: group related images and navigate through them with ease - ideal for your image galleries.
Slideshow Capability: automatically transition between grouped images, includes play/pause and previous and next buttons.
HTML Content Support: ability to show websites or other HTML content in a lightbox.
Video Content Support: ability to show videos in a lightbox.
Visual Effects: fancy pre-loader and transition when you click on the image.
Keyboard Shortcuts: useful keyboard shortcuts for switching between images, toggling play / pause, etc.
Zoom Capability: larger images are reduced in size so they fit snugly inside the browser window. A zoom in button can then be clicked on to see it in its original size, while a zoom out button is provided to return you to the scaled down version.
Choice of Layouts: there are two layouts provided, not including the "Lightbox2 Lite" version.
Automatic Image Detection: configurable automatic re-formatting of image node thumbnails, so there is no need to add 'rel="lightbox"' to each image node link on your site. Image, Inline, Flickr, Acidfree Albums, Image Assist, Embedded Media Field and CCK Imagefield modules are all supported (images must have the "inline", "thumbnail", "image-thumbnail", "preview", "image-preview", etc, classes). It's also possible to configure a list of custom image classes which will trigger the lightbox when clicked on.
Control Over Lightbox Image Size: configure which image size should be displayed in the lightbox, e.g. preview or original.
Image Page Link: a link to the image page can be provided within the lightbox itself. You can even specify if it should be opened in the current window or a new window.
Page Exclusion Capability: exclude certain pages on your site from having the lightbox2 functionality.
Login Support: ability to modify all user/login links so the login form appears in a lightbox.
Skin and Animation Configuration: configure the order and speed of the lightbox animations, along with the lightbox colors, border size and overlay opacity.
Gallery 2 Support: support for Gallery 2 images via the Gallery module (beta). See here for information on how to customise your Gallery2 theme to work with lightbox.
Right-to-Left Language Support: support for right-to-left languages and themes.
Dependencies
Lightbox2 5.x-2.0 and later versions now all use the jQuery library instead of the Scriptaculous and Prototype libraries, so there is no need to download and install a separate third party package. The 5.x versions have a dependency on the jQuery Update module since the version of jQuery included in Drupal core is not that recent. Both jQuery Update 1.x and 2.x versions should work with Lightbox2.