Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedOoops !
Forget the icon on the left : it is add by design !
Comment #2
frjo CreditAttribution: frjo commentedSo your problem is solved?
If you only want to display Image field images one by one, select "No gallery".
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedThe 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 :
Comment #4
frjo CreditAttribution: frjo commentedNot 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.
Comment #5
afterdark CreditAttribution: afterdark commentedUnsubscribe
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commented@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.
Comment #7
frjo CreditAttribution: frjo commentedHave 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.
Comment #8
wrd CreditAttribution: wrd commentedI 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.
Comment #9
frjo CreditAttribution: frjo commentedwrd: 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.
Comment #10
wrd CreditAttribution: wrd commentedThanks, I'll give that a try.
Comment #11
iris_hbo CreditAttribution: iris_hbo commentedMay be this solution could help or inspire someone:
First I print the first image:
print $field_images[0]['view']
Then I print the rest...
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.
Comment #12
Rhodungeon CreditAttribution: Rhodungeon commentedSame 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 :(
Comment #13
deelite CreditAttribution: deelite commentedMy 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!
Comment #14
Zen420 CreditAttribution: Zen420 commentedNot 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.
Comment #15
tfranz CreditAttribution: tfranz commentedI 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:
That's it – but it's bad, because all images will be loaded, but not displayed ...
Comment #16
nocks CreditAttribution: nocks commentedThanks a lot, tfranz, that was a smart idea.... Semantic CCK is also a great module!
Comment #17
lsolesen CreditAttribution: lsolesen commentedMarking 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