Closed (fixed)
Project:
Imagefield Cycle
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2011 at 02:08 UTC
Updated:
5 Oct 2011 at 08:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
nicholasthompsonThat would be a very good/sensible option to have. Currently I believe it'll just have a single image in the "pager" section.
Comment #2
lisarex commentedWe would be happy to create a patch for this, if you'd accept it. We definitely need this to work for single images.
Comment #3
lisarex commentedClarification: I can confirm it's definitely showing a pager even with a single image. I do want one field to handle all images. Imagefield Cycle works great for multiple images, but occasionally there will only be a single image on a node.
Comment #4
amateescu commented@lisarex: do you think that this should be a configurable option? Something like.. "Hide pager if it contains a single item" that will be checked by default.
Comment #5
lisarex commentedAmateescu, I can't think of an instance where a single image + pager would be desirable. So I would just say that if there's a single image, the 'pager thumbnail' is hidden.
Comment #6
lisarex commentedAttached is what the single image + thumbnail looks like. If someone can do a patch that removes thumbnail pager for single images, I'll do a review, since it would be loooovely to have for a client site.
Comment #7
bhavin.ahya commentedfound the solution
I have overridden following theme function to solve this.
Write down the following function in your template.php
function phptemplate_imagefield_cycle_image($image_data, $element, $profile, $key) {
// This just keeps the code neater below
$i = &$image_data;
if ($i['path'] != '') {
return theme('imagecache', $i['presetname'], $i['path'], $i['alt'], $i['title'], $i['attributes'], $i['getsize']);
}
}
Write down the following code in your any .js file
var getthumbimg = $('.thumb-images .thumb-image-item');
if ($(getthumbimg).children('img').length == 1) {
$('.thumb-images').css('display','none');
};
Just clear the cache and refresh the node view page.
let me know if issue still persists.
Comment #8
gregglesHere is that code as a patch to the module.
If it's right, it can be committed with --author="bhavin.ahya " to give credit to bhavin.ahya.
Comment #9
bhavin.ahya commentedThanks greggles.
I have implemented the same and it's working fine.
Comment #10
nicholasthompsonI have committed this to dev. Unfortunately, the "author" parameter caused the following error:
fatal: No existing author found with 'bhavin.ahya'...This fix is good enough for an initial fix. It'd be nice to not have the thumbnail rendered at all if the image count == 1...
Comment #11
gregglesdang, the html filter stripped the important parts. You can find the author attribution information on user profiles (like http://drupal.org/user/379122) in the future.
Thanks, nicholas!
Comment #12
nicholasthompsonAhhh right :) I did not know that! I'm still learning Git... more of an SVN man myself ;)