Multiple galleries in one slideshow
soundsational - January 6, 2008 - 22:35
| Project: | SlideShowPro |
| Version: | 5.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Got this working great, thanks for a cool module.
What i want to know, is it possible to add multiple albums to one slideshow? so when you click on the slideshow button to see other gallery it would appear in the same slideshow instead of having to re-create a page for each gallery to be viewed in slideshow.
thanks,

#1
I am very interested in getting multiple galleries into slideshowpro from drupal. I too have the initial integration set up and working fine. I have read around and found some developers talking about changing the Filters Field in the view (slideShowPro: Image galleries) to be able to select multiple galleries in drupal. But this would still only put all of the images in one album. There would have to be modifications made to the module itself to be able to make multiple opening and closed album tags based on the number of galleries selected. This is a little bit over my head, but I think it is definitely possible. I will keep looking for answers and post them here if i find anything.
#2
I did a small hack for this. It has been awhile, but I think this is what I did. I put this function in my template.php file:
function phptemplate_slideshowpro_feed($view, $nodes, $type) {
global $base_url;
if ($type != 'page' || $view->type != 'slideshowpro_xml') {
return drupal_not_found();
}
$size = 'preview';
foreach ($view->filter as $filter) {
if ($filter['field'] == 'slideshowpro.tid') {
$size = $filter['options'];
}
}
$album_terms = array();
$albums = array();
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<gallery>\n";
foreach ($nodes as $n) {
$node = node_load($n->nid);
$tids = array();
if ($n->tid) {
$tids = array($n->tid);
$album_terms[$n->tid] = taxonomy_get_term($n->tid);
}
// If no image gallery tid was passed in and image gallery is installed, get tids from node.
else if (module_exists('image_gallery')) {
foreach ($node->taxonomy as $term) {
if ($term->vid == _image_gallery_get_vid()) {
$album_terms[$term->tid] = $term;
$tids[] = $term->tid;
}
}
} else {
foreach ($node->taxonomy as $term) {
if ($term->vid == 1) {
$album_terms[$term->tid] = $term;
$tids[] = $term->tid;
}
}
}
// Stick images with no album in an album called "In no album"
if (!count($tids)) {
$tids = array(0);
$album->name = t('In no album');
$album_terms[0] = $album;
}
$image = theme('slideshowpro_xml_image', $node, $size);
// An image can be in more than one album.
foreach ($tids as $tid) {
$albums[$tid][] = $image;
}
}
//ksort($albums);
foreach ($albums as $tid => $images) {
$output .= _slideshowpro_xml_album($album_terms[$tid], $images, $tid);
}
$output .= "</gallery>\n";
drupal_set_header('Content-Type: text/xml; charset=utf-8');
print $output;
module_invoke_all('exit');
exit;
}
I believe the only thing I changed was to add this:
else {foreach ($node->taxonomy as $term) {
if ($term->vid == 1) {
$album_terms[$term->tid] = $term;
$tids[] = $term->tid;
}
}
}
Where my vocabulary id for the taxonomy categories I was using was 1. That should then group into galleries by taxonomy.
I think that is correct anyway, like I said, it was awhile back.
Cheers,
Stephanie
#3
Sorry, something else I think I had to do. In the view, make sure the first thing you order the nodes by is the taxonomy term name.