Followed the readme.txt

When selecting jLightbox: Slideshow for the displaying the imagefield. Nothing shows on the page.
Selecting a imagecache rule will show all images. But without slideshow.

Also no javascript referencing to jlightbox in source code. (jlightbox.js file is includes)

Am i missing something? im using drupal 6.4

Regards

Comments

tijeika’s picture

im using 6.6 drupal, when i chose jLightbox for display in my CCK fields - nothing shows at all!!! there is no image... dont know what to do...

dboulet’s picture

Title: Slideshow not showing » Image field is not displayed
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new4.44 KB

Same as tijeika, nothing showing at all using Drupal 6.9, ImageField 6.x-3.0-alpha4 and ImageCache 6.x-2.0-beta5. The biggest problems with the code are that it makes use hook_field_formatter(), which is now deprecated, and that it does not reflect changes made in the ImageField module, which now relies on the FileField module. I've attached a patch that fixes these problems, and also cleans up some trailing spaces in the code.

dboulet’s picture

StatusFileSize
new4.73 KB

Here's a new version of the last patch which fixes a problem with image alt and title attributes not displaying.

forresto’s picture

this patch is giving me:
warning: unserialize() expects parameter 1 to be string, array given in .../sites/all/modules/jlightbox/jlightbox.module on line 157.

dboulet’s picture

StatusFileSize
new4.74 KB

Here's a new patch, should get rid of that warning.

dboulet’s picture

Sorry, made a small mistake in the last patch, here comes a new one.

dboulet’s picture

StatusFileSize
new4.76 KB
babelfish’s picture

dboulet,
Thanks for patch. I'm trying to get this module to work on D6, applied the last patch but images still don't show up in the image fields.

comargo’s picture

StatusFileSize
new2.09 KB

At least attached patch works on my site, but I don't remember the reason of one change

--- jlightbox.module    15 Oct 2008 08:14:30 -0000      1.9
+++ jlightbox.module    26 Feb 2009 10:50:27 -0000
@@ -97,7 +97,7 @@
   if (!isset($item['fid'])) {
     return '';
   }
-  $file = _imagefield_file_load($item['fid']);
+  $file = field_file_load($item['fid']);
   $item = array_merge($item, $file);
   if (strpos($formatter, 'jlightbox][') !== FALSE) {
     list($module, $namespace, $type) = explode('][', $formatter);
sun’s picture

StatusFileSize
new4.36 KB

Please test this patch instead.

dboulet’s picture

@comargo, regarding your confusion about the change, if you are speaking specifically about the use of the field_file_load() function, I believe that this is used because the D6 version of the Imagefield module now depends on the Filefield module.

dboulet’s picture

With the patch in #10, the images show up but their alt and title attributes are always left blank. I had tried to fix this issue in the patch that I had submitted in #3, here is the bit of code that addresses the problem:

<?php
function theme_jlightbox_formatter($element) {
  if (isset($element['#item']['nid']) && $node = node_load($element['#item']['nid'])) {
    $data = $element['#item']['data'];
    if ($element['#item']['data'] && !is_array($element['#item']['data'])) {
      $data = unserialize($element['#item']['data']);
    }
    foreach ($data as $key => $value) {
      if (!isset($element['#item'][$key])) {
        $element['#item'][$key] = $value;
      }
    }
    return jlightbox_field_formatter($element['#field_name'], $element['#item'], $element['#formatter'], $node);
  }
}
?>
yrre7’s picture

subscribe

dboulet’s picture

StatusFileSize
new4.75 KB

Thought I'd update this issue with my latest code, this is what is working for me.

poiu’s picture

#14 works for me too (though I didn't check with alt and title attrs).

realityloop’s picture

#14 works, but I don't get next/prev links when there are multiple images exposed in a gallery style view

karens’s picture

StatusFileSize
new5.53 KB

The patch is pretty close to working but there are several remaining problems. It leaves the deprecated function in the code, which is confusing, instead of working that code into the new function. More important, it uses form_clean_id() to create gallery names which will make a different gallery name for each image. So instead of getting one gallery with six images you get six galleries with one image, which is why the back/next navigation isn't working (there is no back/next in a gallery with only one image). Also at one point the field name is passed through as the $field, and all the other field values are lost. And finally, there is some code looking for deprecated imagecache functions which could be removed because anyone using the old version of imagecache would have a ton of problems because that version doesn't work at all.

So here is a cleaned up patch that seems to be working.

karens’s picture

StatusFileSize
new5.51 KB

Oops, found one more change. And just to clarify, the changes in #12 are incorporated into this patch (they were in the earlier patch too, but I couldn't tell that for sure by reading the issue).

karens’s picture

StatusFileSize
new5.44 KB

Ugh! Sorry, found one more mistake in the code.

dboulet’s picture

Thanks Karen, this works very well.

realityloop’s picture

@#19 When there are multiple images are I still am not getting the next/previous links when displaying full image, other than that it works great KarenS

dboulet’s picture

@realityloop This works fine for me. In the field display options, have you chosen 'jLightbox: presetname gallery', and not 'jLightbox: presetname'?

realityloop’s picture

Status: Needs review » Reviewed & tested by the community

working here after confirming settings as per #22

plebe’s picture

Tried running this patch. asking me which file to patch. Fails when I specify jlightbox.js. has this been incorporated into the latest 6.x version?

dboulet’s picture

@plebe, This patch only affects the file jlightbox.module, it makes no changes to the JavaScript file.

Funkwarrior’s picture

Component: Code » Miscellaneous
Category: bug » support
Status: Reviewed & tested by the community » Active

sorry, but it's impossible to me to make lightbox works... I apply the patch, js and css wrote correctly on the page, I made a Imagecache preset but there is no rel attribute on my image..
What I'm doing wrong? someone can tell me? Thank you!

dboulet’s picture

Component: Miscellaneous » Code
Category: support » bug
Status: Active » Needs review

@Funkwarrior, I'm assuming that you're trying to get this to work with an imagefield. If this is the case, have you chosen 'jLightbox: presetname gallery' or 'jLightbox: presetname' as the display option for that field?

Gábor Mayer’s picture

cvs version of jlightbox doesn't work with imagefield.

sun’s picture

Status: Needs review » Fixed

Sorry for leaving you all in the dark. Was way too busy with D7. :-/

Thanks for reporting, reviewing, and testing! Committed to HEAD.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

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