Lightbox / Thickbox plugin

Creating and modifying plugins.
Post Reply
NightFire
Regular
Posts: 6
Joined: Thu Nov 16, 2006 5:48 pm

Lightbox / Thickbox plugin

Post by NightFire »

Hi,

Just installed the lightbox / thickbox plugin. Really a nice mod. Using the lightbox js 2 version on our blog website. Only when you have alot of pictures to show in a kind of gallery you have to close the picture and open a new one.
In the original lightbox js script you could use this fuction:

LightBox version 2 adds the ability to group multiple image links together, so an image gallery is created out of the enlarged images:

Code: Select all

<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
<a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a>
<a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a>
Any options / ideas to get this trick working for the blog. Tried this code, but it doesn't work. Also the title tag is not working:

Code: Select all

<a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>
It would be nice if these two features could be activated somehow.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Lightbox / Thickbox plugin

Post by garvinhicking »

Hi!

The problem is that serendipity automagically adds "rel='lightbox'" to every image, so if you already have a 'Rel=lightbox' association to it, serendipity simply overwrites it/appends it.

Sadly it would be both hard to code and also performance intense to perform a lookup to see if a "rel" has already been added to a tag so that I don't really want to add this - mostly because other users usually never use custom 'rels' and it would be a large impact on the performance.

The way I see for you would be to always add 'rel=...' manually to your images. Then you don't need the lightbox plugin at all, and you can simply add the javascript output to a HTML Page Nugget or even write it into you rindex.tpl template file...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply