Closed (fixed)
Project:
Lightbox2
Version:
4.7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
29 Jun 2006 at 14:45 UTC
Updated:
10 May 2007 at 08:44 UTC
Jump to comment: Most recent file
Comments
Comment #1
azote commentedthis would be really nice
Comment #2
yched commentedThis seems like a feature request for Lightbox module
Comment #3
stella commentedI eventually made the following changes to the lightbox javascript code. There may be a better way to do it but this meets my needs.
Change to image_nodes.js:
A similar change was made to image_nodes_nogroup.js:
Changes to lightbox.js, line 352:
line 360:
line 482-483:
I hope this helps someone.
Cheers,
Stella
Comment #4
kleingeist commentedHi,
i just visited this page cause i've been looking for a similiar solution. But i think your code is sort of circular.
There is no need to set the URl explicit as another "parameter", because "title" or imageArray[X][1] isnt used anywhere without the Link. Beside i dont like the idea to abuse the "id" for anything else than an unique identfier for one element.
So the smaller and easier to maintain patch (cause the core lightbox.js isnt touched) could just update image_nodes{_nogroup}.js in the following manner:
parent.title = nodes[i].alt.concat("<br /><br /><a href=\"" + parent.href + "\">View Image Information</a>");Btw. this is also the way suggested on http://www.huddletogether.com/projects/lightbox2/#support
But this implementation still lacks localization support. Unfortunately i have no idea how this could be solved.
Greetings
Comment #5
kleingeist commentedforgot to mention:
parent.title has to be set before parent.href is changed to the direct image url:
greetings
Comment #6
stella commentedI did toy with the idea of putting the link in the title attribute alright, it certainly involves less codes changes. However, I'm just loathe to do it as it is a bad practice, not to mention invalid HTML, to put HTML tags (in this case an anchor tag) within a tag attribute. Certainly, it is a lot easier to do for people who need to patch their own installations, but perhaps other ways should be investigated before including it in source tree.
Cheers,
Stella
Comment #7
kleingeist commentedsorry for the long inactivity. i 've been in holliday. but now im back, and have some recommodations for this matter.
first, i cant find a forbiddance of "html-tags" inside a title. A title should contain "text", which should be human readable, but it is at least a CDATA field. So from the technical side, it could contain the greater (<), the less than (>), the equal (=) symbol and even quotes if they are enclosed in a block. At least this is the information i found about.
But the id attribute is defined more strict: it contains a Name which:"must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")."
So any link of the type node/123 would break the definition, because of the slash. If there would be a block on the gallery page, with the most recent images, it is possible, that this would produce two identical IDs, which should never happen. Something else is mentioned in the reference: "The id attribute shares the same name space as the name attribute when used for anchor names" and "When both attributes are used on a single element, their values must be identical." This is another weakness of dynamic id rewriting.
So i think both methods are not really perfect, but i would currently prefer not to play around with the sensitive id attribute. If it is possible to hack the lightbox.js my proposal would be the follow: Set some global lightbox settings and do image node detection in the lightbox.js. Then it would be possible, to create the link language depenend and theres no more need of extending the link. I've attached my proposel:
Comment #8
stella commentedThis has been added to the new drupal 5.x version of the module lightbox2 5.x-1.x-dev.
Comment #9
stella commentedShould be fixed in both lightbox2 4.7.x-1.0 and lightbox2 5.x-1.1.
Cheers,
Stella
Comment #10
stella commented