Drupal - use lightbox with Views (Rel attribute) - in output link
In Drupal, I have two image fields, one as a thumbnail and the other as an image that opens when clicking on the thumbnail. The only way I could find the link was to use the "Display this field as a link" option and link to the image field.
This works, so when I click the thumbnail it opens a larger image, but I would like to use lightbox2 for this task, but there is no way to set the "rel" attribute in the "Display this field as a link" option.
Is there a way to set the rel attribute or call the lightbox by setting the class?
a source to share
you only need one cck image field to get thumbnail plus full image in lightbox: Lightbox2 - How to use with CCK Imagefield and Imagecache .
UPDATE : Use the Lightbox Trigger field in the Lightbox2 development version section . step by step:
- add a thumbnail and image box to your view.
- check both of them "Exclude from display". do not check "Display this field as a link" anywhere.
- add a lightbox trigger field after both image fields
- configure the "Light Trigger" field:
- for the Trigger field, select the thumbnail field
- for the popup, select the replacement template (scroll down in the edit viewport form for all possible replacement template) of your image field. for example, in my case it is
[field_image_fid]
.
now your view should show your thumbnail and clicking on it should open your full image in a lightbox frame. at least that's what's going on here :)
a source to share