Page 1 of 1

adding jquery lightbox on images

Posted: Thu 23. Aug 2012, 17:02
by rbrickyboy
Hi all,
I am trying to add jquery lightbox on all images uploaded on a certain page,
how could I able to modify the template so I could append the class / id to the image or to its <a> tag.

Thanks

Re: adding jquery lightbox on images

Posted: Sun 26. Aug 2012, 09:59
by Oliver Georgi
Use the following in your template (maybe the Content Part’s one holding the images, untested):

Code: Select all

<!-- INIT_LIGHTBOX -->
Put the following code snippet (maybe name it lightbox.php) in your template/inc_script/frontend_render:

Code: Select all

<?php
if(strpos($content['all'], 'INIT_LIGHTBOX')) {
    initSlimbox();
}
?>
Your image template should look like this:

Code: Select all

<a href="%large-image-source%" rel="lightbox"><img = src="%thumbnail-image-source%" /></a>