3

I am using the Lightbox2 module in Views to make a image larger on click. This works great, but I also want to show a preview of the image on mouse_over. I also use hover_preview module, but I can't seem to use both module with a single view.

Here's a example of what I want:http://gochicorgohome.com/shop/15975,242,49668 (this link is ironic because its Hover_Preview module's example and shows what Lightbox does as well).

So How do I get/find a module that will enlarge image on click AND preview and image on mouse_over like link above.

EDIT. I am using the REWRITE OUTPUT option in order for my image view to show the lightbox formatter effect.

UPDATE: Ok I figured it out: Rewrite However this outputs two images, no link, and "> after the image. I'm guessing my syntax is wrong?

1

I would install both module, set the Lightbox field format in your view, and then try to replicate the output used by the hover_preview module. If you use the browser inspector you will notice that you need two images in top of each other and some classes assigned to them in order to work.

In your view, add those images fields and rewrite the results. See image attached. I hope it helps.

enter image description here

| improve this answer | |
  • Hello, Please see above. I can't figure out why the lightbox effect won't work when I am rewriting the output? Also I can't figure out tokens. Any help? THanks – Benjamin Jones Jan 30 '14 at 16:27
  • Ok I figured it out: Rewrite <a href="[uri]"class="lightbox-processed views-ajax-processed-processed" rel="lightshow[field_images]"> <img src="[field_images] " /></a> However this outputs two images, no link, and "> after the image. I'm guessing my syntax is wrong? – Benjamin Jones Jan 30 '14 at 21:48
  • Hey @BenjaminJones - my guess is that the [field_images] token is printing the whole image markup and not just the source? Try printing it outside by itself. If that's the case, you need to find the correct token. Don't remember from the top of my head. – Teknotica Jan 31 '14 at 9:50
  • Ok. You were right. Its the [field_images] token. Took out rel="lightshow[field_images]", which show image correctly but with out the lightbox2 formatter. How would I find the correct token? Replacement Patterns? – Benjamin Jones Feb 3 '14 at 15:51
  • SO for testing purposes I changed the View Image Formatter to Lightbox2 (From adaptive image.) Lightbox2 effect works like it should. Using firebug the results in Rewrite Ouput should look like this:<a class="lightbox-processed views-ajax-processed-processed" title="" rel="lightbox[field_images][<p><a href="[uri]"></a></p>]" href="[uri]#overlay-context=NathanDufreeGallery" target="_parent"> <img height="122" width="92" alt="" src="[uri] typeof="foaf:Image"> </a> (showing uri not fullpath. However I put this in REWRITE Output and no lightbox effect. – Benjamin Jones Feb 3 '14 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.