Welcome to the Geeks & God Static Archive. Read more »

Creating a Drupal Photo Gallery

User Rating:
Average: 4.2 (42 votes)
FAIL (the browser should render some flash content, not this).

Jeff Eaton created this great video showing how to bring together some modules for drupal to create an easy to use and work with Photo Gallery for your church secretary. It also doesn't require any custom code and works with modules available in Drupal 6 right now. "Add Photo" is even right where the secretary expects to see it.

Some things you learn in this video:

  • Configuring Node Reference URL
  • Using Arguments in Views
  • Using CSS Injector for simple style changes
  • Embedding Views in Nodetypes without any code



This looks like a GREAT gallery recipe!

nicely done


Thank you for this nicely done, transparent demo. Very helpful!

Drupal Noob


I like how the galley works, linking the gallery and the image is a great idea, but I'd like to see a better presentation. I went though it a few times and I feel like I'm missing a few steps. Maybe you could start from scratch next time instead of just showing what you've already done. Are there any reasons why my thumbnails wouldn't showing up?

Where is the Return Path Setting?


I downloaded the most recent Node Reference URL Widget, and that option wasn't available.

Also, it didn't give me the option for teaser content and full node reference link...

The default argument gives me token options, and when I use [nid], that doesn't work.

I've also tried using the default 'Node id from URL' in the 'if argument not present' menu, and that still doesn't work. If i delete the arguments, then all of the photos from every gallery show up on every gallery page, so I know it's a problem with the arguments. What version of all of these modules did you build this in?

Any help would be greatly appreciated, as this is infuriating... does pathauto interfere with views arguments?



It also doesn't require any custom code and works with modules available in Drupal 6 right now. "Add Photo" is even right where the secretary expects to see it.


I'm using this for my D6


I'm using this for my D6 sites - it's more or less the same as the recipe that I was using on D5 sites, but a bit smoother around the edges.

For those having trouble with the views part, the "node content" displays need to be selecting "photo" nodes, which a relationship for the nodereference field, and the Node id argument needs to be set to use that relationship. You set the default argument in the "node content settings" pane there, not in the argument settings.

Great! But a couple of questions ...


This is working almost seamlessly for me on 6.13, with two exceptions:

1) When I click through to a photo from a gallery I see an icon for the photo rather than the photo itself. Clicking on the icon gives me the behavior native to the browser of displaying the photo top,left aligned in a blank, unformatted page.

2) I can't see how to create the page that displays the latest image from each gallery - going to create content and selecting the "gallery" content type creates an individual gallery (e.g., collection of photos) not a collection of links to the existing galleries.

I'm sure I'm missing something obvious. Can anyone offer assistance? I am relatively new at Drupal.

Figured out 1). While viewing

Figured out 1). While viewing the Photo content type, go to "Display Fields" and make sure "Image" is selected under the "Full Node" menu. Hopefully this helps someone else.

Need help with thumbnails


Nice tutorial. But I am having some trouble with the display for "Latest Image" and "Full Gallery". I am only seeing a hyperlink link to the photo instead of seeing the thumbnail in the "Latest Image" view. I can't get the preview to display on the "Full Gallery" view. I figure I'm missing a step along the way. I have searched a few other Photo gallery tutorials and now I think I have messed things up by using 50% from this Geeks and Gods site and 50% from some other tutorial. I started again from scratch but haven't figured it out yet. Anyone else have similar problems?

Display on different page


This is an awesome module and very easy to install. I just can't figure out how to make the gallery display on any other page than the homepage. I'm sure there is something simple that can be done in Views, but I've yet to figure out what it is. Does anybody know the solution to this?

Display on Different Page

I would also be interested in a solution regarding this issue. I too was only able to post the "last image" to the front page by enabling it in the Publishing options - set to Promoted to front Page. There doesn't seem to be a place to configure where a view of display type node content can be set.

If you find a solution please post.

Create another view

I think the most straightforward way to show a list of galleries would be to just create another view.
Just create a view, add a filter to show only nodes of type "Gallery".
Set row style to "Node"
Create a Page display.

Create another view

Worked great! Thanks

There is a Module for this


I just per chance saw the "Views Gallery" plugin for D6. Here's an excerpt from the Module description:
"This module pulls together the techniques Jeff Eaton outlined in http://www.lullabot.com/articles/photo-galleries-v... to automatically create a simple gallery where each gallery is a node with an embedded view of images that were assigned to that gallery. The module creates the content types, sets up the imagecache presets, creates the default gallery view that is embedded into the gallery nodes by Views Attach, and adds css to make it all look nice."

So, it may be easy just to install this module.

Verbal Tic


Ta da!

Works great...I'd previously been using ZenPhoto, but I've been craving a drupal-native solution for a long time.

Edit: also, I tried the simple Features Module approach suggested by the above poster but the necessary views were never created, so I went ahead and followed the vid. YMMV.

Where's the 'Add Photo' button !???


Hi all,

I was able to import the views. All works well (list of galeries, individual galeries & latest image) except for the 'Add Photo' button which I don't see. To be honest, I don't know where it's coming from (Content type? Views?). I don't understand that part of the tutorial.

Can someone be kind enough to explain to an 8 month old Drupal enthusiast what steps he needs to take in order to have the 'Add Photo' button show up and work?

Clickable Image on gallery list view


I've watched the tutorial and seem to have set up the gallery functionality correctly. However, "latest image" thumbnails on the gallery list view are not linked to the gallery. I noticed in the tutorial that the developer has created rollover highlighting for the image, but isn't this give the visitor a false impression that the image is hyperlinked? I also noticed that the tutorial presenter was always careful not to click-through on the gallery thumbnail, but used the gallery title hyperlink instead.

How do we get the gallery thumbnail to link to the gallery?

User reference field?


Can the same method be applied for User reference field. But the option widget doesn't have url reference option. Basically I want to populate user reference field (UID) from the URL on click of an add button (similar to add photo). Let me know if there are any other approach to this.

help on getting back to the gallerys


hi all,
First of all, great work with this gallery.
I have a question!!!
When we are on the node of the picture, and when we return to the photo gallery, can we return to the same page or photo where the picture was?
Instead getting back to the beginning of the gallery


Node Refrance URL not working



I was trying to create image gallery with node reference url as in the videocast

I made the gallery content type and gallery_image content type as shown

After all the settings when i finally add the gallery name and then when i try to add the photo for that gallery
I see a dropdown to select gallery but that dropdown is empty even when i have a gallery created...

I have checked all the settings but i dont know why that drop down shows none..

I have tried it so many times but it doesnt work..... Can you pleaseeeeeeeee help...

Kusum Saini

Thanks for this video. After


Thanks for this video. After I watched it my problem with "using arguments in views" was solved. Btw, I like photo gallery very much, it has a very convenient interface.
Best regards,

Did it work for you

What all modules have you installed??

Actally i am missing something and coz of it my gallery drop down in add photo shows to be empty...

Any clues u have??

Add photo button

Bisonbleu, have you gotten an answer on where the "add photo" button is coming from? I'm having the same problem. It doesn't appear on the gallery page.

No button, a text link instead


Bisonbleu, Drupie,

This technique doesn't result in an "add photo" button, per se, although I'm sure you could create one with a little CSS and/or Javascript.

What it does provide is an "add ..." text link when you are viewing the gallery and have the authority to create a new image node.

Hope this helps,

next and prev images gallery ???


Hi ,

good video..

I have Created a Custom theme i have nice image script from the following website below
Please let me know how do i add it.. i am new bubby on drupal

Nice gallery tutorial but incomplete


I think the latest information we can get are from the author itself, Jeff Eaton from Lullabot web site


I don't understand the two-star review.



I don't understand the two-star review. You're linking to the same video as in the original post.


Oops! OK, here it is...


5 stars!! hehe :D

Hehe, check my latest post.

Gimme five!