Download & Extend

Photoset change from single photo to all photos after upgrade

Project:Flickr
Version:6.x-1.2
Component:flickr_field
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I run a site where I was making fairly extensive use of views using the photoset filter. This used to display one image per photoset (the image chosen to represent the photoset on Flickr).

After upgrading however, it now displays all images in the photoset. I'm guessing this is due to the patch submitted at the end of this issue:
http://drupal.org/node/262591

I'm sure for many applications this is an improvement. However, for generating photogallery-style views using photosets, this change actually takes away a significant functionality, or is even a bug -- what were once grids displaying a few dozen images that linked to full photosets are now pages containing hundreds of images.

Is there a to access the original behavior of displaying a single image instead of the whole photoset?

Thank you,
Eric

Comments

#1

Well, here is what I came up with -- I added a theme override that more or less restored the original behavior of displaying the photoset image and title instead of all images in the photoset.

<?php

/**
* Override the flickrfield_photoset template.
*/
function THEMENAME_flickrfield_photoset($img, $photo_url, $formatter, $photo_data, $node) {
  if (
module_exists('flickr_sets')) {
   
$title = is_array($photo_data['title']) ? $photo_data['title']['_content'] : $photo_data['title'];
    if (
arg(0) == 'node' && arg(1) == $node->nid) {
     
$output = '<div class="flickr-photoset-img">'. $img .'</div>';
    }
    else {
     
$output = '<div class="flickr-photoset-img">'. l($img, 'node/'. $node->nid, array('attributes' => array('title' => $title), 'absolute' => TRUE, 'html' => TRUE)) . '</div>';
    }
   
$output .= '<div class="flickr-citation"><cite>'. l(t('Source: Flickr'), $photo_url) .'</cite></div>';
    return
$output;
  }
}
?>