Closed (fixed)
Project:
Node Gallery
Version:
6.x-2.x-dev
Component:
Lightbox2 Contrib
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2009 at 22:39 UTC
Updated:
28 May 2012 at 04:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
dddave commentedConfirmed in alpha2. Also the text doesn't show in the lightbox view.
Comment #2
dddave commentedSetting to "Choose the content you want to display: Images" solves this for the normal display now. Saddly lightbox is not picking the caption up (which lightbox can do). I consider this a task rather than a bug but feel free to correct me.
Comment #3
kmontyYes, this is definitely an issue that needs to be address at some point.
Comment #4
mblataric commentedNot sure if opening new ticket is required since this two things relate to lightbox window, same as title not showing.
1. Zoom feature does not work. Lightbox resizes itself to fit window when larger image is loaded, but does not show Zoom button. This behavior works fine with Image module, so i'm guessing it has to do with integration of gallery image and lightbox 2
2. It would also be very nice if lightbox would have link "View original image" (and ability to choose preset for it or simply link original image) - this also works with Image module.
Comment #5
kvoltz commentedIs this something that is being addressed? It seems to be a bit quiet at the moment, but this is a feature I would definitely like to have. I made the fatal flaw of showing my client the lightbox before noticing this issue was present. Now I am in a bit of a bind.
Comment #6
kmonty@kvoltz - it is something that needs to be addressed but it isn't happening right now. The module maintainers are extremely busy themselves and there are more pressing needs with this module. If you have a client sponsoring your development time, why don't you contribute a patch? It helps everyone out.
Comment #7
kvoltz commentedTo be honest... I would love to, but I am still a bit new to the whole PHP world. I am getting there... give me another year or so, and I should be contributing. Until then, I will have to find simpler alternatives.
Thanks for your quick response, though!
Comment #8
arnaudfischer commentedSubscribing. Has anybody found a way to add "Title", "Caption", "Details", "Print" links to images from Node Gallery displayed inside the Lightbox window? I might have missed it but searching around this issue I did not find anything. This is an important feature, although I understand you guys are busy. Awesome module! Thank you.
-arnaud
Comment #9
mettam commentedI'm interested in getting this issue solved as well. At the very least, I'd like to see image titles show up in the lightbox view.
I've looked into this enough to see that Node Gallery isn't passing the title to the link when that's put together in the code. By that I mean you get
<a href="http://www.example.com/sites/default/files/imagecache/node-gallery-display/myimage1.jpg" rel="lightbox">without a title="something" or an alt="something". Looking at the Lightbox 2 module, it just needs to see that title or alt tag to add the text to the lightbox view.I'm still fairly new to Drupal and haven't done much on the programming side of it, otherwise I'd just figure out the fix myself. Maybe the title isn't getting passed to the image array?
Anyways, thanks for the great module!
Comment #10
dddave commentedIf you could provide a patch, that would be pure gold. If you (like me) cannot provide patches please share any solution you find. I really hope this problem can be solved in the next release.
Comment #11
UdarEC commentedU`r certainly right. we just have to add title="something" to the image link to fix this bug. I`ll try to fix this and post a patch.
Comment #12
UdarEC commentedHere is a fast fix.
Open file node_gallery/contrib/node_gallery_lightbox2/node_gallery_lightbox2.module
Find function node_gallery_lightbox2_preprocess_gallery_image_thumbnail.
We need to make it look like this:
function node_gallery_lightbox2_preprocess_gallery_image_thumbnail(&$vars) {
$image = $vars['image'];
$config = $vars['config'];
$mode = $vars['mode'];
switch ($mode) {
case NODE_GALLERY_VIEW_TEASER:
if ($config['teaser']['gallery_display_type'] == 'lightbox2_gallery') {
$image_tag = theme('image_view', $config['image_size']['thumbnail'], $image);
$vars['image_output'] = l($image_tag, imagecache_create_url($config['teaser']['lightbox2_gallery'], $image->filepath),
array('html' => TRUE, 'attributes' => array('title' => $image->title,'rel' => 'lightshow['. $image->gid .']')));
}
break;
case NODE_GALLERY_VIEW_IMAGE_LIST:
if ($config['gallery']['gallery_display_type'] == 'lightbox2_gallery') {
$vars['image_output'] = l(theme('image_view', $config['image_size']['thumbnail'], $image),
imagecache_create_url($config['gallery']['lightbox2_gallery_preset'], $image->filepath),
array('html' => TRUE, 'attributes' => array('title' => $image->title,'rel' => 'lightshow[hi]')));
}
break;
}
}
That`s all)
Comment #13
dbeall commented@UdarEC, It works great!
See it work here, http://www.davebeall.com/node-gallery-gallery2/old-buckeye-lake-park
Every one will thank you for this. Made a patch from #12
as dddave would say, it's gold!
EDIT: my patch should have full path in the index.
Index: node_gallery/contrib/node_gallery_lightbox2/node_gallery_lightbox2.module
Comment #14
Tally commentedThanks. The patch works great for the images on the Gallery pages.
It would be perfect if it worked for the images on the Image page and thumbnails shown through Views.
Comment #15
dbeall commentednow I am trying to figure out the body or caption display for lightbox using the example in #12
I think the views is an additional issue. A handler call in (node_gallery.views.inc)
example: 'handler' => 'node_gallery_handler_field_fid',
Comment #16
kmontyMind you, you are only defining the title and not the caption, which was the original request. Solid change, regardless.
Comment #17
kmontyJust committed this patch. I know people are interested in potentially displaying more than the title, in which case we can reopen the ticket.
Comment #18
dbeall commentedI am attempting a look at this, I have a few ideas (additional variable config strings in the contrib module) and there is some discussion about this in the Drupal community.
I might not get anywhere with it, but looking at it anyway. Will report with any progress.
Comment #19
UdarEC commentedGood luck, guys)
Comment #20
dbeall commentedThanks UdarEC, this is in there.. Stop by anytime!
Comment #21
UdarEC commentedPeople, is there any ability to show not only the title, but the caption too? I have no idea about this.
Comment #22
Yaroslav_ki commentedJust one more wish http://drupal.org/node/538764#comment-2234166
Comment #23
Yaroslav_ki commentedMay be use this option of Lightbox2 http://drupal.org/node/276378?, and send not an image, but full image node?
Comment #24
dbeall commenteda work around for the caption in lightbox..
posted by DesignWork
So in your function (theme.inc)
you call twice the $image->title as attribute for theme imagecache. Instead of this you should use it like this
Cheers
Dirk
Comment #25
kmontyI would be worried about injecting that much code into an alt attribute. There must be a better solution.
Comment #26
dbeall commentedi don't know any php yet, so I am in the dark on all this. I just figured it belonged in this thread.
Designwork had it working on his site, but I can't get it to work, there must be some trick to it..
Comment #27
designwork commentedHi kmonty,
we could wrap the image->body with with check_plain($image->body) so its more secure. But for SEO this is also better if the alt tag of an image is different from the title. We could also cut it with
or you can only change the following function like mentioned on this thread.
function node_gallery_lightbox2_preprocess_gallery_image_thumbnail(&$vars) {
$image = $vars['image'];
$config = $vars['config'];
$mode = $vars['mode'];
switch ($mode) {
case NODE_GALLERY_VIEW_TEASER:
if ($config['teaser']['gallery_display_type'] == 'lightbox2_gallery') {
$image_tag = theme('image_view', $config['image_size']['thumbnail'], $image);
$vars['image_output'] = l($image_tag, imagecache_create_url($config['teaser']['lightbox2_gallery'], $image->filepath),
array('html' => TRUE, 'attributes' => array('title' => $image->title, 'alt' => $image->body, 'rel' => 'lightshow['. $image->gid .']')));
}
break;
case NODE_GALLERY_VIEW_IMAGE_LIST:
if ($config['gallery']['gallery_display_type'] == 'lightbox2_gallery') {
$vars['image_output'] = l(theme('image_view', $config['image_size']['thumbnail'], $image),
imagecache_create_url($config['gallery']['lightbox2_gallery_preset'], $image->filepath),
array('html' => TRUE, 'attributes' => array('title' => $image->title, 'alt' => $image->body,'rel' => 'lightshow[hi]')));
}
break;
}
}
Cheers
Dirk
Comment #28
designwork commentedHi dbeall,
I´m not using lightbox2. This is a different js, that makes an automated slide show with thumbnails, timer ect. of the Images in a gallery. I`m thinking to make a contrib module with a few js and a hook form alter to inject more display option for galleries.
Cheers
Dirk
Comment #30
RedTop commentedI too would like lightbox to display the caption. I have tried both suggested workarounds, but none seem to have the desired effect. Any progress on this?
Comment #31
kmontyTest the latest dev release before reopening issues.
Comment #32
robray commentedThere a couple of people in a bind (as I was) with no caption displaying in Lightbox2 when using node_gallery.
If you don't care about the Image title, you can swap caption for the title with relative ease.
WARNING: this is not long term fix, this should not be a patch, this shouldn't be contributed to any sort of public source control system, etc. This is a HACK. But it is quick and easy, and just might get a client off your back for a while until a better solution is in place.
This will require editing two cases in
node_gallery_lightbox2.module's node_gallery_lightbox2_preprocess_gallery_image_thumbnail function.
case NODE_GALLERY_VIEW_TEASER: and case NODE_GALLERY_VIEW_IMAGE_LIST:
to
array('title' => $image->body
You will also probably want to edit the lightbox.css to make the caption pretty.
Ex: de-bolding the font weight, making the imageData width something longer than 70% etc.
- Rob
Comment #33
mikeyw commentedAnother option to get the caption working is to add a second set of '[]' to the rel attribute as described in the lightbox2 module help: "Optional: To show a caption either use the title attribute or put in the second set of [] of the rel attribute."
So here is the code that works for me in node_gallery_lightbox2_preprocess_gallery_image_thumbnail:
...
case NODE_GALLERY_VIEW_TEASER:
if ($config['teaser']['gallery_display_type'] == 'lightbox2_gallery') {
$image_tag = theme('image_view', $config['image_size']['thumbnail'], $image);
$vars['image_output'] = l($image_tag, imagecache_create_url($config['teaser']['lightbox2_gallery'], $image->filepath),
array('html' => TRUE, 'attributes' => array('title' => $image->title, 'rel' => 'lightshow['. $image->gid .'][' . check_plain($image->body) . ']')));
}
break;
case NODE_GALLERY_VIEW_IMAGE_LIST:
if ($config['gallery']['gallery_display_type'] == 'lightbox2_gallery') {
$vars['image_output'] = l(theme('image_view', $config['image_size']['thumbnail'], $image),
imagecache_create_url($config['gallery']['lightbox2_gallery_preset'], $image->filepath),
array('html' => TRUE, 'attributes' => array('title' => $image->title, 'rel' => 'lightshow[hi][' . check_plain($image->body) . ']')));
}
break;
...
Comment #34
technicka commentedIs this functionality now part of any release of Node Gallery? I am running version 6.x-2.0-alpha10 and I am still having the issue. Would be great if both caption and title were available in Lightbox view.
Thank you
PS: I tried 6.x-2.0-beta2 and now I get a title but still no caption.
Comment #35
justintime commentedAFAIK, the lightbox2 contrib module will go away with NG3, because the straight-up lightbox module supports views and cck. I haven't personally tried it, but it should be fairly easy to do.
Comment #36
dokpm0 commentedThe comments here have been very helpful. I didn't know about the option to pass additional markup via the rel tag. That's much easier than the method I've been using on my site, which I'm working on converting to Drupal. With the notes here I've managed to duplicate the lightbox functionality from my site using node_gallery. If there's a caption it displays title - caption followed by a separate paragraph with a "bookmarkable view" link pointing to the non-lightbox node_gallery image view, an "original size" link, and a "lightbox navigation help" link pointing to a page with info on the keybaord shortcuts, etc. Many thanks to the node_gallery and node_gallery lightbox2 developers!!!
Comment #37
Amyfers commentedThe caption doesnt work for the recent versions of Lightbox, like 6.1.11 :(
Instead, uninstall your current lightbox and go here: http://drupal.org/node/55200/release
Scroll down to lightbox2 6.x-1.9 and download, install, enjoy your captions :)
Comment #38
mikedotexe commentedThis is so weird because I have a development site where the latest version works, but it won't work on my live site. My IT guys who run the server say that configurations are identical. I'm pulling my hair out trying to find the difference.
Comment #39
asad.hasan commentedQuick javascript theme hack:
Won't work in old browsers because it depends on a new js event.