Better Image Galleries?

categories:

Introduction

Drupal is a great content management system, which I use on virtually every site that I develop. However, I have found one specific feature that is difficult to implement. Specifically, I would like to develop a site in which users can add photos to the sites, and can assign them a category from a given hierarchical category. I would then like the site to behave much like Gallery2 does, where a user can "drill down" through categories until they find the specific images that they are looking for.

Difficulties

This is relatively difficult to do in Drupal. I typically set up photo node types using the CCK and imagefield modules. I then use the imagecache module to resize, crop, scale, etc. the images as needed. For the categorization I simply use Drupal's core Taxonomy module. This provides a great way for users to add photos to the site. However, there is still a navigation problem.

Nodes listings, like those that I desire, are typically generated with the Views module. However, it is not possible to list Categories easily with Views. So, for example I can easily obtain a list of photos that have been categorized with the same category. However, at higher levels in the navigation Views can not easily provide lists of categories. I typically overcome this problem by placing my own custom block that lists the categories above the view. Although this works, it is not user-friendly or customizable.

The Solution

This Gallery2-like feature set seems like it would be very useful to the Drupal community. As a result, I think that I will begin writing a module that will provide many features like those of Gallery2. I realize that there are some existing modules (e.g. Image, AcidFree, etc.) that provide some of this functionality. However, I would like to develop this module to be incorporated with the CCK, imagefield and imagecache modules, which seem much more versatile and much more in line with the future of Drupal. I will try to regularly update this blog as I begin to write the module. This is my first attempt to write a module, so I should learn lots of useful things along the way.

Mike Goodwin

The Red Leaf Media blog is written by Mike Goodwin. Mike has been developing websites for three years using the Drupal content management system. He is experienced with XHTML, CSS, PHP, SQL and jQuery. If you would like to contact Mike, please use our contact form.