Hi !

I use Colorbox with Per field gallery option. On the final rendering each gallery' images is displayed on the page with an icon on left side.
Colorbox works fine : I just did not find the way to display only one image for the gallery.

Regards

Comments

Anonymous’s picture

Ooops !

Forget the icon on the left : it is add by design !

frjo’s picture

Status: Active » Fixed

So your problem is solved?

If you only want to display Image field images one by one, select "No gallery".

Anonymous’s picture

Status: Fixed » Active

The problem is solved because the customer I work for changed is mind !
But the question is still alive : how to display only one image for the gallery ?

If it is not possible it should be a new feature : display gallery using only one image with colorbox opening when clicking on it. This image could be :

  • the first one
  • or any image of the gallery marked as thumb image
  • or another image the administrator could choose.
frjo’s picture

Not really sure what you want to accomplish.

You have the display field settings for each node type where you can set if the Colorbox should be active or not per field.

afterdark’s picture

Unsubscribe

Anonymous’s picture

@frjo,

I wanted to display a gallery using only one image and not all the images of the field. When user click on this image then colorbox gallery is displayed.

frjo’s picture

Have you an image field where you have uploaded a number of images, and you only want to "Colorbox" the first image and not all the others?

If this is the case I suggest you create a second Image field and activate Colorbox on only one of them.

The term "gallery" in Colorbox is used for grouping a number of images together so when you open a Colorbox you can navigate to previous/next image within the group.

wrd’s picture

I think I know what he's asking for, and I'm running into the same thing myself.

Say I have a single Image field, with unlimited images permitted in the field. I upload four images into the field.

When I look at the node, I see four thumbnails, one for each image. If I click on any of the four thumbnails, I get an imagebox opening up that allows me to navigate through the four full-size images.

What would be a cool option is if I could designate one of the four thumbnails as being, for lack of a better term, the primary thumbnail. This would be the only one that would be displayed in the node. Clicking this thumbnail would open the colorbox, which would allow the user to flip through all four images.

I don't know, though, this might be better handled by a cycle module.

frjo’s picture

Version: 6.x-1.0-beta4 » 6.x-1.0-beta6

wrd: Use two imagefields, on for the primary image and one for all the rest. Make an image cache preset that scale the thumnails to 1x1 pixels and use that for the secound imagefield, and/or hide it with CSS display: none.

wrd’s picture

Thanks, I'll give that a try.

iris_hbo’s picture

Version: 6.x-1.0-beta6 » 6.x-1.0-beta7
Component: User interface » Miscellaneous

May be this solution could help or inspire someone:
First I print the first image:

print $field_images[0]['view']

Then I print the rest...

foreach ($field_images as $key => $image) {
	if ($key > 0) {
		print '<a title="' . $title . '" class="colorbox imagefield imagefield-field_images" href="/sites/default/files/imagecache/pop_up/images/' . $image['filename'] . 'rel="gallery-' . $node->nid . '"></a>';
	}
}

The advantage of frjo's solution with css display:none is, that you can use the formatters and don't need to write the whole path and then print only the filename, which is not nice, but maybe the performance is better like this.

Rhodungeon’s picture

Same wish here guys! It would be great if we could choose only one image to show in the colorbox thumbnail.
The problem in my case is that I need all the images to be uploaded through the same CCK field... the code above is not working for me :(

deelite’s picture

My solution:

I use http://drupal.org/project/field_slideshow for displaying the image in the node. In the field-settings i set the trasition speed to a loooooooooong time and linked it with the colorbox.

But i think, a slideshow in the node is not realy a bad idea.

Thanks to the developers of Colorbox and Field Slideshow!

Zen420’s picture

Not a bad approach deelite, Ill have to give that a try.. Seems like the simplest method on this thread. Im new to Drupal and not ready to dive into CSS and PHP.... yet :) , so this seems like a nice workaround.

tfranz’s picture

I installed the module semantic_cck (D6) to add a css-class "first" to the first image and disabled the display of all other images:

1. install http://drupal.org/project/semantic_cck
2. go to the configuration form for the image-field. Just activate the Semantic CCK options at the bottom.
3. add CSS, for example:

field-type-filefield .field-item {display: none;}
field-type-filefield .field-item.first {display: block;}

That's it – but it's bad, because all images will be loaded, but not displayed ...

nocks’s picture

Thanks a lot, tfranz, that was a smart idea.... Semantic CCK is also a great module!

lsolesen’s picture

Title: How to display image gallery with only one image ? » Howto display an entire gallery just using one image as the trigger
Status: Active » Fixed

Marking as fixed as there is an answer. Think it is also related to #1393874: Single Thumbnail That Opens a Slideshow with 'Per field per post gallery' option

Status: Fixed » Closed (fixed)

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