Creating a Drupal Photo Gallery
For an upcoming Drupal website project, the client requested that they would like a Photo Gallery on their site that would contain a number of Galleries in one section, with each gallery easy to navigate through an be accessible from each other, without having to get lost going back and forth between them.
Previous Drupal Photo Galleries I have done have been quite simple and look great. Usually with each image in a gallery shown as thumbnails on a page which open in a Lightbox or Thickbox window. But with this new project I needed something a little different, and after searching around I remembered a website that had recently launched using Drupal, which had a great Photo Gallery that would be perfect for what I needed.... The Whitehouse's new website http://www.whitehouse.gov/photogallery.
After checking out their Photo Gallery, it didn't take long to realise the Photo Gallery could be easily replicated with just a few Drupal Contrib Modules. Don't get me wrong though, I'm not saying the the Whitehouse's Photo Gallery is simple and they just threw together a couple of modules and they had a Gallery. It looks like they have done some very nice work on it and added their own customisation to get it the way they wanted it. All I'm saying is that the basic functionality of the Gallery can be achieved with some Contrib Modules and a little bit of configuring and CSS.
I will split this Tutorial into two posts. This post I will go though how to setup the gallery, the next post I will run through how to display a listing of galleries with Ajax navigation and filters at the bottom of your Photo Gallery, similar to the Whitehouse's Gallery – http://www.whitehouse.gov/photogallery.
Step 1. Download and install the following Contrib Modules.
*Note: Check for additional required modules for any of the modules listed above to function, and download and install them also as instructed. Also, this Tutorial is based on Drupal 6 so you will need to download the 6x version of each module.
Step 2. Setting up the Galleria Module
- Create or choose an existing content type that will display the Galleria.
- Add an ImageField (called FileField in the "Data type" drop-down) to the content type in the "Manage fields" section.
- Set your desired configuration as per standard ImageField settings.
- Click the "Display fields" section for the content type.
- Change the output formatter for "Full node" and/or "Teaser" to display "Galleria".
- Create a node of the content type you used in the previous step, upload a few images (say 10 or so) and view your node. The node should load displaying a large image with thumbnails with navigation. As seen in the Demo here.
Step 2. Setting your Galleria Gallery to us ImageCache
Now we want to use ImageCache to set how we want to display the large image and the thumbnails in our Gallery.
- Create a thumbnail preset to how you would like your thumbnails to look. Cropping, resizing etc.
- Create a image preset for your large image. Cropping, resizing etc.
- Go to the configuration settings for the Galleria Module at 'admin/settings/galleria'.
- Under the section 'ImageCache integration', use the Dropdown to select the preset you created for the Large image and the thumbnails. Save.
- View your Gallery, it should now be displaying the images as per your presets. You may need to tweak your presets so have a play until you are happy.
Step 3. jCarousel
Now that we have our Gallery set up displaying a main image with thumbnails underneath which we can click and navigate through, we want to change it so that all the thumbnails display in a carousel which will enable a large number of thumbnails to be easily visible, like the Whitehouse's Gallery – http://www.whitehouse.gov/photogallery.
- Go to the configuration settings for the Galleria Module at 'admin/settings/galleria'.
- Under the section 'jCarousel integration' we can configure how we want the jCarousel to work. Set it to 'enabled', the other settings you will need to play with as it will depend on how many thumbnails you will want to show in your gallery and how you've setup you thumbnail preset.
- Save your changes.
Viewing your gallery - your thumbnails should now be using the jCarousel. If not, make sure you have added enough images to your gallery or check over your settings. You will most likely need to play around with the 'jCarousel integration' settings and also your thumbnail ImageCache presets and your CSS to get your gallery looking the way you need it to.
Hopefully, once you have finished playing with your settings etc. your gallery should now look similar to the Whitehouse's Gallery – http://www.whitehouse.gov/photogallery.
Let me know if you have any questions about this tutorial and keep an eye out for Part 2 which I will post soon.
What others have said!
Hi f,
Each node should represent a 'Gallery' with multiple images. Galleria will turn all the images you upload to that one node into a gallery.
Are you currently only able to upload just 1 image to a node? If so, go to your content type again and manage your fields and configure the imagefield you created and make sure under 'Global Settings', the 'number of values' drop down is changed from 1 to unlimited. 'Unlimited' will provide an 'Add more' button so you can add multiple images to your node.
Once you add a few images to your node, you should then see more than one image when viewing that node/gallery.
Hope that helps
by:
Jamie
on:
29 Jul 2010
@ 4:37 pm
Hi mbtech,
If I understand you correctly, in your cck image field for your content type you have set the path to be "files/attachments/imagefield_thumbs"? If so this is where the original image you upload will be stored.
If you have created an imagecache preset called 'Galleria_Full', imagecache will save its versions of your original image after it has processed them into the folder "/files/attachments/imagecache/Galleria_Full/" So each imagecache preset you create, it will place those images into its own imagecache folder for it to access, whilst the original image you uploaded through cck remains untouched.
Is your gallery working as expected? From what you have mentioned your gallery should work fine. Were you just after some help regarding the paths?
by:
f.
on:
30 Jun 2010
@ 11:56 pm
Got lost at "Create a node of the content type you used in the previous step, upload a few images (say 10 or so) and view your node. The node should load displaying a large image with thumbnails with navigation. As seen in the Demo here.".
I am quite new to Drupal, so that probably is related to the fact that I'm lost :)
I executed all previous steps and create a new content node of the newly created type. If I understand correctly, I can only upload one image per node? So what about "create a node and upload a few images?". When I go to the node, I see one picture, no thumbnails.
Any help is appreciated :)
by:
mbtech
on:
30 Jun 2010
@ 10:55 pm
Hallo,
this ist a good tutorial.
I figured out this, but I have a problem with the filepath of imagecache.
If I upload pictures with cck imagefield, imagecache save them under:
/files/attachments/imagefield_thumbs/imagename.jpg
and galleria want to load them from:
/files/attachments/imagecache/Galleria_Full/picturename.jpg (where "Galleria_Full" ist the imagecach preset setting under galleria settings.
Is this a generel modul-problem causing in a modul-change?
Can you help me?
by:
Jamie
on:
22 Jun 2010
@ 3:08 pm
Hi Stephen,
Glad you found the tutorial helpful. Try and put your code in the Galleria modules galleria.tpl.php file - that may work for you. In relation to the play/pause button, that would be a great feature, I haven't come across any scripts to implement this.
A good starting point may be to post a feature request on the Galleria modules issues page at http://drupal.org/project/issues/galleria You might find the community behind it may have some helpful tips for you or someone may have already implemented it.
Good luck with it! Let us know how you go. Cheers
by:
Jamie
on:
4 May 2010
@ 2:06 pm
Hi John,
Glad you liked it!
You can find Part 2 here - http://www.ireckon.com/blog/content-management-systems/1255-adding-a-nice-navigation-to-your-drupal-gallery
by:
John Kromodimedjo
on:
12 Mar 2010
@ 7:06 am
I really like this tutorial; i have used it myself for my site and it work well!!!
Any ideas when part 2 will be posted.
Thanks.
John
Search By Theme
- The Wondrous Wide Web (20 posts)
- Search Engine Optimisation (27 posts)
- Programming and Coding for the Web (26 posts)
- Web Design (44 posts)
- Social Media (1 posts)
- Marketing (16 posts)
- Inside Ireckon (15 posts)
- Content Management Systems (11 posts)
- Conversion Optimisation (4 posts)
- Recent Stuff (7 posts)
- Web Gadgets (2 posts)
- Daily Inspiration (1 posts)
- Darryl's Blog



by:
Jamie
on:
29 Jul 2010
@ 4:39 pm