ZenphotoCMS Forum
How to link thumbnail to resized photo in lightbox? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: How to link thumbnail to resized photo in lightbox? (/thread-5745.html)



How to link thumbnail to resized photo in lightbox? - revo - 2009-08-25

Hi,

I currently have my thumbnails linking to the full sized version of the image in lightbox. Does anyone know how to link it to the resized image that gets generated by ZP? I've tried replacing with but that doesn't allow me to go from one image to the next in the lightbox window. Clicking on next just gives me a lightbox window with the loading icon.

Any help would be appreciated.




How to link thumbnail to resized photo in lightbox? - acrylian - 2009-08-26

So, did you read the instruction for light box with several images. You have to add a css class to the html image tag.
Also note, if you use pagination on the thumbnail page, the lightbox next/prev will only work for the current page.




How to link thumbnail to resized photo in lightbox? - revo - 2009-08-26

Hi acrylian,

Thanks for the reply.

Yes, I read the lightbox instructions and have added the following image tag rel="lightbox[]". I do not have pagination on my thumbnail page.

Can you direct me on how I can get my thumbnail to link my thumbnails to the resized cached image that is generated by ZP?

Thanks again.




How to link thumbnail to resized photo in lightbox? - acrylian - 2009-08-26

Well, `does nothing. Use it either withechoorprintAlbumTitle(). Best would probably be to useechp getBareAlbumTitle()since we are dealing with JS here and a album title can contain specials chars JS does not like that much. Actually using the album name withecho $_zp_current_album->name` might be better.

Another recommendation: Don't use php short tags `




How to link thumbnail to resized photo in lightbox? - revo - 2009-08-26

I've changed my output to: " rel="lightbox[]" title="">

Can you point me in the right direction as to what to replace with, to get the resized image that ZP creates to appear?

Thanks




How to link thumbnail to resized photo in lightbox? - acrylian - 2009-08-27

It is not possible to link to the sized image from within lightbox. The sized image is processed if not already cached and not always directly an image, but this scripts needs a direct link to the actual image. So this will not always work as expected. (tried this with Thickbox).
If you want to try:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetDefaultSizedImage
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetCustomImageURL




How to link thumbnail to resized photo in lightbox? - revo - 2009-08-27

Perfect! using getDefaultSizedImage did the charm!

Thanks for your help acrylian!