views:

789

answers:

1

In Drupal I have two image fields, one to act as a thumbnail and the other the image that will open when the thumbnail is clicked. The only way I could find to link the two was to use the option for "Output this field as a link" and link to the image field.

This works, so when I click the thumbnail it opens the larger image however I would like to use lightbox2 for this task but in the "Output this field as a link" options there is no way to set the "rel" attribute.

Is there a way to either set the rel attribute or invoke the lightbox by setting a class?

+2  A: 

you only need a single cck imagefield to get thumbnail plus full image in lightbox: Lightbox2 - How to use with CCK Imagefield and Imagecache.

UPDATE: use the "Lightbox Trigger" Views field of the Lightbox2 development version. step by step:

  • add both your thumbnail and your image field to your view
  • mark both of them "Exclude from display". don't check "Output this field as a link" anywhere.
  • add a "Lightbox trigger" field after both of your image fields
  • configure the "Lightbox trigger" field:
    • for "Trigger field", select your thumbnail field
    • for "Popup", select the Replacement pattern (scroll further down in the view field edit form for all possible replacement pattern) of your image field. for example, in my case, this is [field_image_fid].

now, your view should show your thumbnail image and, clicking on it, should open your full image in a lightbox frame. at least that's what's happening here :)

ax
I'm looking to allow the user to create a thumbnail that links to a different image
kilrizzy
see my updated answer for a solution :)
ax
Nice that should do it!
kilrizzy