Drupal Tutorials and Blog Posts

Creating a Photo Gallery in Drupal

November 16, 2010 | Written by Steve Burge

Creating a photo gallery is the same as with most things in Drupal: there are many different ways to reach your goal.

In this tutorial we're going to show you the quickest and easiest way: using the Node Gallery module.

Install Node Gallery

tutuploadsmedia_1289929501315.png

 

  In order to install Node Gallery, we'll need to download and install four different modules:

 

Upload those module folders to /sites/all/modules/ and then go to Administer >> Site Building >> Modules to enable them.

Create the Photo Gallery

tutuploadsmedia_1289930181248.png

In your Drupal site, click Create Content >> Gallery.

tutuploadsmedia_1289930246228.png

You'll be prompted to set up a node, just as per normal. The only difference is that this node will serve to hold all your photos in a particular gallery. When you've given a name and description for the photo galley, click Save.

tutuploadsmedia_1289930266540.png

You'll now be taken to the finished node. Click on "Upload Images" you'll be prompted to do just that.

tutuploadsmedia_1289930353113.png

Once you've selected the images, click "Submit Images".

tutuploadsmedia_1289930467950.png

When you're finished, the node will look like the screenshot above.

If you click on the photos, you'll see a screenshot like the one below with large versions of the image plus Previous / Next buttons.

tutuploadsmedia_1289930484245.png

Gallery Layout

tutuploadsmedia_1289931726555.png

Node Gallery will also automatically create a menu link to a list of all the galleries.

Configuring Node Gallery

tutuploadsmedia_1289931896725.png

The sizes and modifications performed on all the images are controlled by the ImageCache module that we uploaded earlier. Go to Administer >> Site Building >> Blocks and you'll see three different options:

  • node-gallery-cover
  • node-gallery-display
  • node-gallery-thumbnail

ImageCache uses these presets to automatically create the cover images, main display images and the thumbnails. If you click on "Edit" you can change the size of all these defaults.

More settings are also available from Site Configuration >> Node Gallery


 

Comments  

 
#1 icekin 2010-11-18 20:24
Is there a way to bulk upload and import images to this type of gallery? What about integration with desktop software like Picasa etc?
 
 
#2 David2010 2010-11-19 01:13
Almost a good tutorial. By default the files get uploaded into the sites/default/files folder. Although the ImageCache module looks in the sites/default/files/imagecache folder. How can this be corrected?
 
 
#3 priyanka 2010-11-30 06:50
hey ,its gud
its wrkng bt for anonomeous user it is not showing any link to open gallery plz suggest me something wht to do wth this
 
 
#4 kl6H_steve 2010-11-30 09:03
Hi priyanka

Have you gone to User Management >> Permissions and given them access to the see the Node Gallery?
 
 
#5 kl6H_steve 2010-11-30 09:05
Hi icekin - yes to bulk upload, no to Picasa (as far as I know)
 
 
#6 David2010 2010-11-30 12:35
I created a new Drupal installation for this tutorial. After uploading the selected pictures, none of the pictures are displayed. Is a there specific configuration required to get this working?
 
 
#7 kl6H_steve 2010-12-01 07:48
Hi David

Can you try using the Webdeveloper toolbar for Firefox. That has a "Find Broken Images" link that will help you to see where Drupal is looking for the photos.
 
 
#8 Ryan1978 2011-01-17 15:29
I am also having a problem uploading like David2010. The images upload directly into sites/default/files instead of into ../files/imagecache/

Can anyone help tell me how to fix this problem?
 

Add comment