Modifying Standard Image Gallery

Events happening in the community are now at Drupal community events on www.drupal.org.
jimmb's picture

Hello,

I have set up an image gallery using CCK/Views (and the other modules described in that tutorial) with fair results here:

http://vfamilycoffee.com/gallery

But it leaves me actually wishing that I could just modify the "standard" image content type-based gallery instead, as I like everything about the way it works except for one thing:

  • Why, oh why, when you click into an image doesn't it take you to a Pager-type scenario where you can click forward and backward through the other images in that gallery??

Does anyone know of a way to get that functionality into that Image Gallery framework?

Thanks,

Jim

Comments

Gallery Pagers

danpen's picture

Does anyone know of a way to get that functionality into that Image Gallery framework?

I use the Custom Pagers Module on my Photography Site.

You need to create a simple view that will contain all the nodes in a gallery, use the gallery taxonomy term as an argument. Then configure a Custom Pager based on that view. It doesn't matter whether you actually use the view for anything else or not so long as it exists.

cheers

Dan

Awesome - yes, that's

jimmb's picture

Awesome - yes, that's exactly what I was thinking! Thanks for letting me know it's possible w/out hacking, and illuminating the basic process.... I will be sure to give it a try :)

Jim

Aw some thing isn't right

jimmb's picture

Well, I've been trying it out and for some reason it's not working. Here's my implementation of your steps:

1. You need to create a simple view that will contain all the nodes in a gallery

I've done that here: http://www.vfamilycoffee.com/igallery/2005+Trip+to+Honduras

2. use the gallery taxonomy term as an argument.

Yes, from the above URL I believe that it's working as you describe

3. Then configure a Custom Pager based on that view.

I set it up so that "Pager visibility" is set to the node type "Image" (I also tried "Image Gallery" and both together) and under "Use a view" I've selected the view mentioned above.

It doesn't matter whether you actually use the view for anything else or not so long as it exists.

This last sentence confuses me - which probably means I'm missing the logic behind the steps. I don't totally see the purpose of making the view or setting up a taxonomy term-based argument at this point ....

If you start at http://www.vfamilycoffee.com/image, click on one of the taxonomy terms (ex - "2005 Trip to Honduras") or the picture, you come to a page showing thumbnails of all the photos in the gallery. But when you click on an individual picture, the pager doesn't appear.

I'm just not sure what I'm doing wrong - if you (or anyone else) has any ideas I'd sure appreciate hearing them!

Thanks again,

Jim

My settings

danpen's picture

I don't know why it might not be working but I can tell you what I did in a bit more detail, it may help.

The view has an argument of Taxonomy: Term ID, and I pass a Gallery Taxonomy ID into it. I don't think any of the other settings will make much difference to the pager.

The Pager is set to display on Image Nodes, using that view and the view-argument is [term-id], which is the ID of the top Taxonomy Term. You'll need to make sure that the Gallery Taxonomy is the highest Taxonomy that applies to image nodes by giving it a lower weight than any others.

Now it should work, it doesn't matter if you never use the view to display the images on the site, whenever an image node loads, it will pass the arguments into a view and use the results from that to build it's pagers.

cheers

Dan

Got it working

ingomueller.net's picture

Hey Jim,

as a pretty new user of drupal, I didn't get the pager working either first, but now I've got it working. This is what I did:

0) Install the token module (http://drupal.org/project/token).

1) Create a new view (admin/build/views). Let's say you call it "gallery". You don't need to fill in anything under "Page". Under "Arguments", add a "Taxonomy: Term ID" type of argument, then set option to 0 (don't know whether this is a clever value, but it works). Under "Sort criteria", add "Node: Created Time", then set its order to "Descinding".

2) Add a new pager (admin/build/custom pager). Under "By node type", choose "Image". Under "Use a view", pick "gallery". In the "View arguments" field, put "[term-id]".

That's it! The view now determines, which photos are displayed and in which order. This depends on the argument passed to in, the term ID. If you want, this means that you have a view for each taxonomy term. The custom order now adds a pager to the elements of such a view. With the token module, every taxonomy term gets its own pager automatically.

I hope this helps you! If not, just let me know.

Regards, Ingo

Thanks + 2 more questions

jimmb's picture

Your post is very helpful (for a relative newbie like me). Now I just have 2 more questions:

  • When you pass the Gallery Taxonomy ID into the argument, where do you put that - in Title or Option or....?
  • And under the Arguments "Default" setting, do you put "Summary, sorted as a view" or something else, or does it matter?

Thanks for your advice - I'm sure some others will find it useful too.

Jim

Answers

danpen's picture
  • When you pass the Gallery Taxonomy ID into the argument, where do you put that - in Title or Option or....?

and the view-argument is [term-id] - You put it in the view argument field of the pager, it is the pager that will "call" the view to be created.

  • And under the Arguments "Default" setting, do you put "Summary, sorted as a view" or something else, or does it matter?

It doesn't really matter, that's what will show up if the TermID isn't entered or doesn't exist. As this view will be called by the Custom Pager from an image node using a taxonomy term on the Node it will always be there and will always exist.

cheers

Dan

Thickbox

wonder95's picture

Have you tried the Thickbox module? I've used it in a few places, and it does exactly what you want.

I use the

kellyharding@drupal.org's picture

I use the CCK/Views/Imagecache/Imagefield module method too. It is working fairly well for me now.

The bit about 'needing a view to exist' you refer to above is so you do not get a error because if the view doesn't exist, the pager will try to reference it.

I've also found a way to upload multiple images at once. Actually two ways.

One, is embedded mediafield's import module. This allows you to import from (currently onyl) flickr. Of course flickr isn't ideal due to Yahoo!'s policy of taking copyright ownership of everything uploaded (read the terms of service).

Second method is, search drupal.org for imagefield import. Its not a contributed module (ie doesn't appear under project/[module] pages, but is in the CVS, I've tried it on a test site. It does work.

Second method limitations are: only imports files from one folder (usually files/images/import), no method of adding taxonomy terms to images when uploading. However, it does allow you to add a title and body to every image if finds in the import directory when you go to do a import. So all you'd be left to do would be to edit the uploaded images to have the correct taxonomy term. Might even be able to do that with a workflow or scripting with php?

Photography

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week