Allow different module path than sites/all/modules

Ander5 - December 2, 2007 - 04:49
Project:jQuery Lightbox
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

When opening an image into a popup, the close image "button" that is normally in the lower right corner is not shown (period) in the latest version of firefox, and IE just shows the typical "image not found" x thing.

#1

Ander5 - December 2, 2007 - 04:54

Upon further investigation, I noticed the path to the image is "/sites/all/modules/jlightbox/images/closelabel.gif" which is incorrect. In my case, it should be "/cnwc/modules/jlightbox/images/closelabel.gif". Hopefully this additional information is useful.

#2

cglusky - December 5, 2007 - 09:34

According to latest release notes the path to images has been fixed, but it does not look like the changes were committed. I am still showing the incorrect path in 5.x-1.1, which causes the missing loading and close gif. Otherwise seems to work well.

#3

Ander5 - December 6, 2007 - 19:35

So in other words I need to wait until the author commits the changes and re-uploads the module?

#4

sun - December 6, 2007 - 21:24
Title:Close image (and possibly others) not showing up» Allow different module path than sites/all/modules
Version:5.x-1.1» 5.x-1.x-dev
Component:User interface» Code
Category:bug report» feature request

No, jLightbox is not yet able to support different module paths than the default sites/all/modules currently. If you put jLightbox into sites/all/modules, it will work.

AFAIK, a different path would have to be passed via Drupal.settings(), thus being another javascript snippet slowing down your site. I would like to fix this soon (without performance issues), however, I just don't feel comfortable with additional inline javascript on each page request.

Any suggestions/solutions, and of course patches, are welcome.

#5

1.kenthomas - March 6, 2008 - 22:23
Category:feature request» bug report

drupal_get_path('module', 'jlightbox') .'/images/closelabel.gif'

#6

vthirteen - March 9, 2008 - 11:51

i have the last stable release of jlightbox installed in the /sites/all/modules directory but the closelabel image is not displayed. i suspect that when drupal is not installed in the root the /sites... link is not working properly (goes to server root instead of drupal root). if not there might be some interference with the i18n module (that adds language to the path).

so, is the code suggested above supposed to be put in the following line of the jlightbox.uncompressed.js file?

fileBottomNavCloseImage: '/sites/all/modules/jlightbox/images/closelabel.gif',

and then renaming as jlightbox.js ?

thank you

#7

vthirteen - July 24, 2008 - 02:10

up

#8

csevb10 - October 17, 2008 - 22:44

I'd be all for a Drupal settings addition or inline javascript so that the site structure doesn't impact the functionality of this module. I like the module, I just don't like having to throw 1 module into the main /sites/all/modules directory when everything else is nested under contrib. If time avails, I'll try and put together a patch early next week

#9

prof1337 - April 13, 2009 - 18:19
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:active» needs review

Here's a patch for the Drupal 6 version that gives the images absolute paths based on a global JavaScript variable. A Drupal.behaviors function updates the "fileLoadingImage" and "fileBottomNavCloseImage" paths using this value and then initializes the lightbox.

Now the loading and close-button images are displayed regardless of the location of the module!

AttachmentSize
jlightbox_image_fix.patch 1.75 KB

#10

pazzypunk - July 23, 2009 - 22:02
Version:6.x-1.x-dev» 5.x-1.3

Is there a way to add this php snippet in the js file?

drupal_get_path('module', 'jlightbox') .'/images/closelabel.gif'

#11

sun - August 2, 2009 - 01:43

@@ -468,6 +468,8 @@
+ Lightbox.fileLoadingImage = Drupal.settings.jlightbox_path+'/images/loading.gif';
+ Lightbox.fileBottomNavCloseImage = Drupal.settings.jlightbox_path+'/images/closelabel.gif';

There should be a space before and after the JS string concatenation operator.

This review is powered by Dreditor.

#12

sun - August 2, 2009 - 01:49
Version:5.x-1.3» 6.x-1.0
Status:needs review» fixed

Thanks for reporting, reviewing, and testing! Committed to 6.x.

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

#13

System Message - August 16, 2009 - 01:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.