I'm not sure whether I'm using the module correctly, but when I request a photoset, either as a node or using 'views' / field, it just returns one lump of Only local images are allowed. tags. No titles are displayed.

So I've done a temporary hack to the main module file:

function theme_flickr_photoset($ps, $owner, $size, $attribs = NULL) {
  if (module_exists('flickr_sets')) {
	$output .= "<div class='flickr-photoset'>\n";
	$photos = flickr_set_load($ps['id']);
	foreach ((array) $photos['photoset']['photo'] as $photo) {
	  //insert owner into $photo because theme_flickr_photo needs it
	  $photo['owner'] = $owner;
	  $output .= "<div class='flickr-photoset-frame'>\n";
	  $output .= "<div class='flickr-photoset-photo'>\n";
	  $output .= theme('flickr_photo', $photo, $size) . "\n";
	  $output .= "</div>\n";
	  $output .= "<div class='flickr-photoset-title'>\n";
	  $output .= $photo['title'];
	  $output .= "</div>\n";
	  $output .= "</div>\n";
	}
    $output .= '</div>';
	return $output;
  } else {
    $img = flickr_img($ps, $size, $attribs);    
    $output = theme('pager', NULL, variable_get('flickr_photos_per_page', 20));
    $photo_url = flickr_photoset_page_url($owner, $ps['id']);    
    $output .= "<div class='flickr-photoset'>\n";
    $title = is_array($ps['title']) ? $ps['title']['_content'] : $ps['title'];   
    return l($img, $photo_url, array('attributes' => array('title' => $title), 'absolute' => TRUE, 'html' => TRUE));
  }
}

Which seems to work. Is there a better way of achieving the end result?

See http://www.gear7.co.uk/gallery for an example.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lolandese’s picture

Version: 6.x-1.2 » 7.x-1.x-dev
Status: Active » Fixed

Sorry for the late reply.

In the latest D7 dev version of the module an image is structured as:

<span class="flickr-wrap">
  <a href="example.jpg" class="colorbox rel="gallery-all">
    <img class=" flickr-photo-img" src="example.jpg">
  </a>
  <span class="flickr-credit">
    <a href="http://www.flickr.com/photos/userID/photoID" title="View on Flickr. To enlarge click pic.">
      Title grabbed from Flickr 
    </a>
  </span>
</span>

CSS takes care of the display. As you can see some new features are present as well, such as colorbox/lightbox and title captions.

Why is 'span' used instead of 'div'? See http://stackoverflow.com/a/1611172.

Would this have been sufficient for your use case? Feel free to re-open if not or if a backport to D6 is needed.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lolandese’s picture

Title: More divs for easier styling of photoset output » More css classes for easier styling
Status: Closed (fixed) » Active

Now that the caption can contain the title and extra info like date, location and author, we could provide classes at a more fine-grained level to target those.

lolandese’s picture

lolandese’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

  • Commit 1df3ca6 on 7.x-1.x by lolandese:
    Issue #925262 by cjwood555: More fine-grained classes to target title...
lolandese’s picture

Added some more extensive documentation at https://drupal.org/node/2170535#html.

lolandese’s picture

Status: Patch (to be ported) » Closed (won't fix)
lolandese’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (won't fix) » Closed (fixed)

Setting this back to D7 and being 'fixed (closed)'.

Main reason is the fact that links to this issue show the status on hover without revealing the version (6 or 7). This might give the impression that the mentioned issue will not be solved, while in fact it is already fixed for the D7 version. 'Fixed (closed)' reflects the current status correctly for D7. 'Closed (won't fix)' is only valid for the minimally maintained D6 version of the module.