adding jquery lightbox on images

Please post all install related problems here. Visit this forum first for troubleshooting.
Post Reply
Posts: 7
Joined: Wed 22. Aug 2012, 17:35

adding jquery lightbox on images

Post by rbrickyboy » Thu 23. Aug 2012, 17:02

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.


User avatar
Oliver Georgi
Site Admin
Posts: 9593
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia

Re: adding jquery lightbox on images

Post by Oliver Georgi » Sun 26. Aug 2012, 09:59

Use the following in your template (maybe the Content Part’s one holding the images, untested):

Code: Select all

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

Code: Select all

if(strpos($content['all'], 'INIT_LIGHTBOX')) {
Your image template should look like this:

Code: Select all

<a href="%large-image-source%" rel="lightbox"><img = src="%thumbnail-image-source%" /></a>
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

Post Reply