By mvdz2011 on
I'm using Drupal 7 and would like to use Lightbox. Since the Lightbox module isn't available yet for Drupal 7 I figured I'd try and add lightbox manually to the pages on which I need it. I added the scripts to the page using the code below.
The scripts are located in /sites/default/files/js, the lightbox css and images are located in my themes css and images folder.
Since it isn't working I'm obviously doing something wrong. What I'm doing wrong isn't obvious to me however.
Is there anyone out there that is willing to point out the rookie mistake(s) I'm making?
<?php
drupal_add_js('..js/scriptaculous.js?load=effects,builder');
drupal_add_js('..js//prototype.js');
drupal_add_js('..js/lightbox.js');
?>
Comments
I did some work at a drupal 7
I did some work at a drupal 7 port of lightbox, just read http://drupal.org/node/670820#comment-4125648 and see if what is working is enought for you, as the d7 version do not have all features fron d6 yet, but i am working on it.
Fernando Correa da Conceição
http://jaguaribe.net.br
Wow that was fast. I'm going
Wow that was fast. I'm going to try it out. And thank you for you work on this! It makes things a whole lot easier for people like me.
Hi Yukare, I added your port
Hi Yukare,
I added your port (added the content of the zip to a folder Lightbox2 in de modules folder). If I enable I get a series of errors like the one below in the module panel.
Notice: Undefined index: presetname in lightbox2_theme() (line 1052 of D:\wamp\www\sites\all\modules\Lightbox2\lightbox2.module).
Every page in my site gets the error
Notice: Undefined index: title in _filter_list_cmp() (line 593 of D:\wamp\www\modules\filter\filter.module).
Did I do it wrong?
manual installation
I am also installing some modules manually since many D6 modules are not ready to work with D7.
In the case of Lightbox2 (and other modules) remember that scripts have to go into <head> </head>
I introduce these in html.tpl.php in templates folder .. just before </head>
p.s.
Incidentally your drupal_add_js scripts above are incorrect (even though drupal_add_js adds scripts into <body> and not <head> where they are required to work - see lightbox installation notes).
you have written ..js where the directory path should be ../js
and you have written // where only / is required.
Thanks, I got lightbox
Thanks, I got lightbox working by putting the script in html.tpl.php. Ran into some problems because both lightbox and the drupal admin menu use overlay as a css class. Solved that one by changing the css class of the admin menu.
Now I got a new problem though. Views isn't working anymore. When I try to add a display I get the message:
"An error occurred while attempting to process /?q=admin/structure/views/ajax/add-display/viewname: iterator is undefined"
When I remove the lightbox scripts from html.tpl.php everything works fine again.
Subscribing
Subcribing. Thanks Yukare for the good (ongoing) work!
why not using colorbox
why not using colorbox instead?
Flickr integration
I'm depending on the Flickr filter/sets integration. If I'm missing something, and colorbox does that-- please let me know!
I tried colorbox (beta 2 for
I tried colorbox (beta 2 for drupal 7). Everything went fine untill I came to the point where I had to change the display format under "manage display". With colorbox installed I wasn't able to change the format to (or to any other setting)
you mean, you are not able to
you mean, you are not able to change the format to "colorbox" instead of "image" under manage display? for me it worked very well. also in combination with field_slideshow (very practical!)
Cannot format (or to any other setting)
I'm having this same issue. I cannot change the display format of an image in, say, Article content type. When I select "colorbox" from the drop-down menu it will not save / update (just spins & spins). Seems I am unable to update any other display format type either (i.e., Body from Default to Trimmed). Could this be a bug with Colorbox, an issue with Core or a problem with my and mvdz2011's (see comment above) installations?