Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As og_gallery doesn't seem to work for me, I did this to the same effect. Not quite complete but looking for help on the last step!
- Install CCK, views, imagefield CCK, imagecache, image api and organic groups (obviously)
- Create a new node type with an imagefield. Configure this how you like.
- Follow the imagecache documentation to set up whatever sizes you want - but also include a thumbnail size suitable for gallery views. Suggest 150x150px max and callign it "thumb".
- Add a new view that provides a page, with the path "node/$node-group/gallery". Set view type to list view, and set a pager for how many pics you want on each page. I also set "provide menu" and "provide menu as tab" so it shows up in the group menu.
- Set the fields to your imagefield you defined earlier. Here's where the imagecache magic comes in - in "option" select "thumb as link to node" (assuming that's what you called your small size). And the node title too if you like!
- In arguments, set "og: group nids" to "display all values".
- In filters set "node: type" to "image" (or whatever you called your image node type)
- This will now give you an unordered list of all the gallery items per group. Now all that remains is to write a css style rule to make these show up inline rather than as a list.
Assuming your view is called "og_gallery"
Make views-list-og_gallery.tpl.php
<?php
drupal_add_css(path_to_theme() .'/views-list-og_gallery.css');
print $field_image_fid_label;
echo "<div class='image_normalize'>";
print $field_image_fid;
echo "</div><br/>\n";
print $title_label;
print $title;
?>
And here's an example views-list-og_gallery.css
.view-content-og-gallery .item-list li {
float: left;
width: 150px;
height: 100%;
background-image: none;
padding: 4px;
margin: 3px;
text-align: center;
background-color: #eee;
}
/**
* CSS rules to vertical and center align the image
* http://www.jakpsatweb.cz/css/css-vertical-center-solution.html
*/
.view-content-og-gallery .item-list li .image_normalize {
height: 150px;
width: 150px;
display: table;
overflow: hidden;
}
.view-content-og-gallery .item-list li .image_normalize a.imagecache {
display: table-cell;
vertical-align: middle;
}
.view-content-og-gallery .item-list li .image_normalize img {
text-align: center;
}
.view-content-og-gallery .item-list ul {
list-style-type: none;
}