Galerie

The Galerie module provides (hopefuly) easy to use and clean galleries based on an API/submodules model.

galerie itself provides a "galerie" node type and manages the display of galleries (classic thumbnails and large images view, and slideshow mode) while submodules retrieve content from different sources: local files, Flickr or Tumblr for now.

Available sources

galerie_directory
Displays the images found in a choosen directory in Drupal's site root.
Allows to upload new images to this directory.
galerie_flickr
Displays Flickr images matching certain tags and/or a user, or images in a set.
Needs an API key that can be created there.
Does not allow submitting images to Flickr, but this might be possible in the future.
galerie_tumblr
Displays the photo posts of a Tumblr tumblelog.
Allows posting photo entries to a tumblelog.
galerie_imgur
Displays the images in an Imgur gallery.
Filtering with search terms is only supported by Imgur for some galleries.
Does not allow uploading images.

Adding sources

Creating new submodules is meant to be very simple for developers, a submodule basically provides:

  • A settings form through hook_galerie_form($node, $form_state);
  • A hook_galerie_list($node, $offset, $count) implementation which returns a list of images;
  • A hook_galerie_image_info($node, $image_id) implementation returning information on one image;
  • And a hook_galerie_types() implementation for describing which types of galleries it provides.

Display modes

Standard gallery
The default display mode of a gallery is a simple view with a list of thumbnails (with infinite scrolling) on the left, and a full image view on the right. This is of course customisable through CSS and/or templates.
If the colorbox module is installed, you have the option to open thumbnails in colorbox popups instead.
Slideshow
All galleries can be displayed as slideshows.
Map
Geolocated images can be displayed on a map, if the geolocation information is either provided by the backend (Flickr), encoded in the photo Exif tags (for local files) or input by the user (local files, Tumblr, theoretically any backend).
Please give me feedback regarding this feature, as the interface might still be a bit rough!

Hooks

hook_galerie_types()
Returns a list of gallery types provided by the module, an array of arrays in the following format indexed by type name:
  • title human-readable title for this type
  • description description of the type of gallery
  • module name of the module that manages this type
hook_galerie_form($node, $form_state)
Returns a form array of settings to append to the add/edit form for $node.
This hook is called for all nodes having a gallery type defined by the module.
A module will typically use hook_node_insert(), hook_node_update() and hook_node_delete() to save these settings.
hook_galerie_list($node, $offset, $count)
Returns a list a $count images in the gallery $node, skipping the $offset first images.
The return is an array of image info arrays, using the same format as hook_galerie_image_info.
hook_galerie_image_info($node, $image_id)
Returns information on image $image_id in the gallery $node.
The return is an array with the following keys:
  • id identifier for the image, the (gallery, image id) pair must be unique
  • src src attribute of the image (should be around 500px wide, but any size will do)
  • thumb-src src attribute of the image thumbnail (must be a 75x75 square)
  • link target of the image link, this can be a link to the original image for example
  • title title of the image (optional)
  • description a description text that will be displayed under the image (optional)
  • date date of the image (optional)
  • extra extra information that will be displayed after description (optional)
  • actions an array of links that will be displayed in a list when the mouse is over the image, this can be links to edit, delete, etc, the image (optional)

Screenshots

What a gallery looks like with a default Drupal installation:
Galerie screenshot

And what the slideshow mode looks like:
Slideshow screenshot

Project information

Releases