I have implemented image galleries where each gallery is a term in the "Gallery" vocabulary. "Photo" nodes -- which store an image (ImageField) and a caption -- are tagged with those gallery terms. Hopefully that makes sense. I had no trouble getting Views to display a grid of thumbnail images for each gallery (filtered by the appropriate taxonomy term).

The gallery functionality works great, but I hit a snag when trying to use Views to create a "gallery of galleries". I'd like to output a grid of galleries, with each gallery represented by a thumbnail image (already created by ImageCache) and it's title, both linking to the full gallery. I'm not picky about which thumbnail is used -- it could be the first image, last image, random -- whatever will work.

Here's a diagram of what I'm trying to do:

|                                                                     |
| Photo Galleries:                                                    |
|                                                                     |
|     ---------------       ---------------       ---------------     |
|     |             |       |             |       |             |     |
|     |  Gallery 1  |       |  Gallery 2  |       |  Gallery 3  |     |
|     |    Photo    |       |    Photo    |       |    Photo    |     |
|     |  Thumbnail  |       |  Thumbnail  |       |  Thumbnail  |     |
|     |             |       |             |       |             |     |
|     ---------------       ---------------       ---------------     |
|                                                                     |
|     Gallery 1 Title       Gallery 2 Title       Gallery 3 Title     |
|                                                                     |
|                                                                     |

I'm relatively new to Drupal, but I am fairly proficient in the Views UI. I have done basic theming with .tpl files before, so I could use that if necessary. I just need someone to point me in the right direction.

Thanks!

Austin

Comments

WorldFallz’s picture

I couldn't figure out how to do this with views either. I ended up making galleries a new content type with a nodereference field for the default image for the gallery as well as a viewfield for displaying the images that belong to the gallery. It's more complex, but it gives me complete control of image and gallery displays.

still, i'd still be curious to figure out how to do this... might be time for another look. i'll post back if i get anywhere.

akurtz’s picture

Thanks! Please do let me know if you find a solution!

Anyone else have any ideas?

akurtz’s picture

Anyone? Please?

sumitshekhawat7331’s picture

check this you want the same thing

http://www.clixarama.com/

CandC540’s picture

I need this feature.

Subscribing

CandC540’s picture

akurtz’s picture

Hallelujah -- that worked! Thanks for the link!

ericpugh’s picture

This method didn't really fit what I was doing because I had predetermined galleries set up by taxonomy. Users can add images to existing galleries, but cannot create their own. So, the "teaser list" view doesn't work for me to show my "gallery of galleries" page.

I'm not sure if there is a better way of doing this, but this is what I came up with. I have a similar setup, with a page view that takes a term id as an argument, to display a particular gallery. (an example page might be example.com/gallery/11 where 11 is the term id) Now to get to those galleries I need a grid of thumbnails links. So, I created a second view called gallery_thumb, which is a single thumbnail and term name, which also takes a term id argument, and is set to link to "gallery/%1."

This gives me one of my galleries. Now I loop through my "Image Galleries" vocabulary on a page and insert the gallery_thumb view for each term to give me a thumbnail grid of links to all my galleries. I created a page and used the following snippet (with php filter, of course)

<?php

    $vid=2; //the vid of the desired vocabulary

    //get array of terms
    $tree = taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL);
   // print_r($tree);
   print "<div id=\"galleries-grid\">";
   
   foreach ($tree as $term) {
		print "<div class=\"gallery-grid-item\">";
   		$view = 'gallery_thumb';
		$display = 'block';
		print views_embed_view($view, $display, $term->tid);
		print "</div>";

	}
	print "</div>";
 	
?>

Hope that makes sense.

j3sika’s picture

I cant tell you how much this snippet helped me. a thousand thanks.
works like a champ.