Fri 18 Jul 2008
Credit where credit’s due — The Art Lab’s original post about this “maintainable gallery”. I’m only updating this with adding on how to do multiple galleries.
First: a fresh install on Drupal 5.8 (Drupal 6 modules aren’t QUITE there yet, I tried!)
Enable Clean URLs
Required modules

Enable the following on your Modules page:
- Content
- Imagefield
- ImageAPI
- ImageAPI GD2 or ImageAPI ImageMagick
- Imagecache
- Imagecache UI
- Thickbox
- Bonus: grid view
- Views
- Views UI
Make the Imagecache presets
Site building –> Imagecache –> Add New Preset
Make one called “thumbnail.”

And make one called “display.”

Add Image Content Type
Add new content type called “Image” and then click “Add Field.”
Call it “photo” and select Image as the field type.
Click on “Display Fields” and choose “Hidden” for the label, “Thickbox thumbnail” as the teaser and “Thickbox display” as the Full. (This step is not necessary — but would be helpful if you were using this field for Page content that had a teaser block or a teaser on the front page.)
Add Gallery View
Now make a new View called Gallery. Under Page, check Provide Page View. Make the URL “gallery.” Select Bonus: Grid View for the View Type, check Use Pager and enter 24 as the number of Nodes per Page. Go down to Fields and select Image: Photo (field_photo). Select Do not group multiple values and select Thickbox: thumbnail under Option. Under Filters, select Node: Type is one of Image and Node: Published Equals Yes. Click save.
Test!
Go to Create content –> Image to add your first image to the gallery. To make sure it worked, go to yoursite.com/gallery.


If this all goes well, you are ready to use taxonomy to make multiple galleries!
Categories
Adding categories to your content is an easy way to organize it, and is especially powerful when combined with Views. Go to Administer –> Content Management –> Categories and click on “Add Vocabulary.” This is the name of the type of category this is. So, Gallery or Image Gallery would be good fit. Now, you need to add terms to make your different galleries. In my case, I’d like to make a gallery for different photo subjects, like Gardening, Dog and Remodeling. Click Add Terms, and add these in, one at a time.

Let’s try adding a new image and tagging it with a category. It will still show up in your gallery because you have not filtered the galleries yet.
Go to Administer –> Site building –> Views
Next to your Gallery view, click the “Clone” button. This will duplicate your Gallery view and you can edit it to filter ONLY the Images tagged with “Dog.” Change the name, description and url. Under filters, select Taxonomy: Terms for Gallery. Select Dog next to “Is All Of” in the filter and Save. Now check your new URL for this filtered gallery!
If there is time remaining, we will go over adding an image field to Page content.
ADDED AFTER DRUPAL DAZE PRESENTATION
You can also do some really cool stuff by adding an exposed filter to the gallery, letting people select which gallery to view — or by using arguments in your original view to dynamically create your galleries! These came out of our discussion after the presentation, very cool!
July 18th, 2008 at 7:16 am
[…] Go to the author’s original blog: Simple Drupal image gallery […]
August 4th, 2008 at 3:36 pm
Any idea to have a simple gallery in D6?
August 4th, 2008 at 7:40 pm
I think the idea is to use the filefield module with CCK and define that field as being for images only. Then from what I can tell, the Grid view comes built into the Views module for 6. I didn’t spend a WHOLE lot of time trying to get this to solution to work for 6, but it seemed to not quite be there yet! I’ll update if I can get it to work — but I’m having trouble making the transition to 6 in general…
August 19th, 2008 at 5:54 pm
Thanks man! I made my gallery. Just a few modifications of your tutorial. I was needing to group the pictures in specific albums (local, date, etc), not in categories.
So in the view config, i change “Do not group multiple values” to “Show first value only” and “select Thickbox: thumbnail” to “thumbnail as link.
I Added Node:title, too. This way i think my problem was solved. If you have a better sugestion, please let us know.
September 19th, 2008 at 4:17 pm
This is great! Thanks! Is there an easy way to have my display image link back to the node rather than the next image in the gallery?
September 22nd, 2008 at 1:11 am
Hmm, there doesn’t seem to be a very easy way to do that. There is a little “close” button on the image, but, you are right, clicking on the image takes you to the next one.
To change this, I think you’d need to customize the thickbox javascript — override the module’s with your own, I’d guess… sorry I can’t be more help!
November 8th, 2008 at 1:54 am
I found that the simplest way for me to do this was to add another field to the view for Node:Title and let it create a link. In my customers’ case, it worked great, but I’ve seen several others who really want this fixed.