In Firefox 2, Safari 3 and Opera 9, placing text containing html into the title of the <a> tag works fine when viewing the image within Lightbox2, but also shows raw code when the cursor hovers over the smaller image in the node.

I realize this is probably more of an html issue than a Lightbox2 issue, but it would be good to have a way to get around this because when working with images that have longer captions, the visible code ends up compromising an otherwise nice site design.

Example from the readme, for reference:<a href="images/image-1.jpg" rel="lightbox" title='<a href="http://www.yourlink.com">Clicky Visit Link</a>'>image #1</a>

Comments

silurius’s picture

Category: bug » support
stella’s picture

Status: Active » Fixed

I've just committed a fix for this to CVS. It should fix the majority of cases. If you want to test this out, please try out the next dev release (available later today). I haven't supplied a patch as there are a number of other changes already made to the code and the patch may not apply cleanly.

Cheers,
Stella

silurius’s picture

Thanks! Will try to make some time to test the dev release later today or tomorrow.

Mark Linden’s picture

still showing up under the latest Dev

stella’s picture

Setup your link like:

<a href="/path/to/large_image.jpg" rel="lightbox"><a href="/path/to/thumbnail.jpg" alt="My alt text" title="My title text"></a>

and it should work.

IE browsers use the image 'alt' text to display the hover tooltip, whereas Firefox uses the "title" attribute of the image. If this attribute isn't set, it will use the anchor's title attribute (which will contain html). So by setting the 'title' attribute on the img tag you shouldn't see the html when hovering over the link/image.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

stella’s picture

Released in Lightbox2 6.x-1.6 and 5.x-2.6.

Cheers,
Stella

jrefano’s picture

Status: Closed (fixed) » Active

i am still having this issue:

<a title="<h2>Auto Finance</h2>Auto Finance Caption" rel="lightvideo" width:320px; height:240px;]" href="/files/Player.swf?file=/files/original/16_AutoFinance.flv&autostart=true">
Show Video</a>

still shows visible html in the hover tooltip - <h2>Auto Finance</h2>Auto Finance Caption. however, I need to include that HTML to properly format the text in the videobox that pops up.

i dont understand your alt/title tag post. i tried setting the alt tag to something else and i dont see any results.

thanks

stella’s picture

Status: Active » Fixed

The alt/title referred to img tags that may appear within the anchor link - i.e. in place of your "Show Video" text. There's no way to avoid it in your example unless you use an image instead of the text.

(By the way, you're missing a [ in the rel attribute in your example, but i presume that's just a typo.).

Cheers,
Stella

jrefano’s picture

hi stella, thanks for your quick response.

maybe this should be a feature request, as i feel that there needs to be a way to handle this situation. my example was simplified (and yes, contained a typo), but im working on a view template where it displays one of the text fields as a link to a lightbox.

perhaps adding arguments to the rel attribute similarly to how the width and height are specified might help, for example:

<a title="Auto Finance" rel="lightvideo [width:320px; height:240px; title:'Auto Finance'; caption:'Caption Text';]" href="videofile.fla">Show Video</a>

while we're at it, adding a group to that list of arguments probably would be a good idea. (this is not as important to me but seemed along the same lines)

i dont think I'm experienced enough to patch it myself but this seems possible, right?

stella’s picture

Grouping for videos is not something I plan on adding at the moment.

Regarding your idea of adding the caption text to the rel attribute, well I'm still undecided on this, but you should probably open a new feature request for this rather than continuing the discussion here.

Also, please upgrade to the latest release before opening a feature request: Lightbox2 5.x-2.7.

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

cota’s picture

Version: 5.x-2.5 » 6.x-1.x-dev
Status: Closed (fixed) » Postponed (maintainer needs more info)

I am running 6.x-1.x-dev (2008-Sep-05) in a standard Drupal Image photo
gallery at http://cotaford6.com/image.

I am using the Automatic image handling but the rel="lightbox" is not being set automatically. These gallery pages are built dynamically and I can not set it manually.

Hope you can help.

-cota

stella’s picture

Version: 6.x-1.x-dev » 5.x-2.5
Status: Postponed (maintainer needs more info) » Closed (fixed)

cota: please open a new issue for your request. Please also provide information on what is happening that is incorrect. I just tried viewing your site in FF3 on a Mac and it looks fine. So please also provide details on the browsers and platforms it happens in, in your new ticket.

Cheers,
Stella

kmi’s picture

I think I've got the same problem - didn't change anything in the module (no captions in title - not sure what it is) and in FF and Safari on a Mac everything is fine but IE displays weird HTML when the mouse is over an opened image.

please see here: www.sklony.ru
press a thumbnail and on bigger image there will be something like

>Alt=fa100-0011_IMG.JPG<br /><br /><a href="/content/kmih-22102008-0">View Image Details</a>

I'm using Lightbox2 5.x-2.8

what can be done about that?
thank you in advance!

kmi’s picture

hi stella! thanks for the reply - that was not quite what I needed, but still this link gave me an idea - I solved my problem by hacking line 1748 of lightbox2.module :

/* $caption = $image_title . $node_link; */ $caption = "";