joelbindi’s picture

I too would love to see fancybox for Drupal 6

jsm174’s picture

8.83 KB
38.83 KB

Attached is a D6 version of FancyBox.

The D5 code has been updated quite a bit to match Lightbox2.

Admin form moved to
All easing options are now selectable.
The opacity is selectable from 0.0 to 1.0.
The animation speeds are now based in seconds.
The form is validated.
Added Image Scale option.
Added Center On Scroll option.
Updated CSS class or id help.
All True/False options are now checkboxes.
Uninstall variables added.
jQuery 1.3.2 has been removed to reduce space.
Requires jQuery update 2.x

Please test at let me know if I need to fix anything.

-- Jason

jsm174’s picture

Adding remaining files were not listed in patch file.


jsm174’s picture

39.8 KB

I just made one more update. The overlay color is now configurable in the admin form.

Attached is the new version.

-- Jason

designcrs’s picture

how about putting this on the "releases" page?

jsm174’s picture

I really wouldn't mind becoming a co-maintainer for this.

Just let me know.

-- Jason

ximo’s picture

Hi. I've contacted fivepoints and have been given co-maintainership of this module. I'll get a D6 branch up and running within a few days.

jsm174: Nice work on the D6 port! Since you also want co-maintainership, we should discuss the scope and focus of the module so that we're all on the same page. Solipsist and myself are prepared to co-maintain the D6 branch of this module in any case.

jsm174’s picture

ximo: Thank you! That is fantastic news. Just let me know when you and Solipsist would like to discuss.

-- Jason

jsm174’s picture

BTW, I have a patch for the current Fancybox (1.2.1) that fixes the padding in IE. I contacted the author, but have yet to hear back.


if (isIE) {
   $("#fancy_content")[0].style.setExpression('height', '(this.parentNode.clientHeight - 20)');
   $("#fancy_content")[0].style.setExpression('width', '(this.parentNode.clientWidth - 20)');


if (isIE) {
   $("#fancy_content")[0].style.setExpression('height', '(this.parentNode.clientHeight - ' + pad*2 + ')');
   $("#fancy_content")[0].style.setExpression('width', '(this.parentNode.clientWidth - ' + pad*2 + ')');

-- Jason

designcrs’s picture

bump - it's so hard to find in here. how about adding this to the releases?

logicalpat’s picture


budda’s picture

Priority: Minor » Normal

Any chance of the co-maintainer releasing a 6.x version yet?

michaelj’s picture

Category: feature » task
Issue tags: +fancy box
34.04 KB

Hi, this is working module for Drupal 6 (I'm not sure if it's bug free), it has imagefield (with imagecache) and image module support.

michaelj’s picture

30.26 KB

hmm Attachment

AdrianB’s picture


Phil Wolstenholme’s picture

368.66 KB

Thanks for this port, it's things like this that make me love open source!

Two things though:

In the settings I can't find an option to set the class to trigger the fancybox as described below:

Enter a fancybox class id in the module's settings. ".fancylink" (without the quotes) should be ok.

Also, my titles don't seem to display properly (see attached screenshot). This happens in both Opera and Firefox.

Huge thanks for your hard work though!

Phil Wolstenholme’s picture

I've seen from going through the source that we use the class .fancy_box on links, but an option to use a class or ID without fiddling around with the .js files would be great. I would like to be able to use a custom ID so my old lightbox links still work :)

Phil Wolstenholme’s picture

Additionally, Padding: is the label for almost every option! :)


Padding around content


Changes content transparency when animating


Speed in miliseconds of the zooming-in animation (no animation if 0)


Speed in miliseconds of the zooming-out animation (no animation if 0)


Speed in miliseconds of the animation when changing gallery items (no animation if 0)

Titles are also not centered like they are on the fancybox website's example page. This is in Opera and FireFox again.

Thanks! Sorry for pointing out the bugs, but I hope it's useful!

Hummer’s picture

It seems at least on my setup that including video or anything else then picture/galleries (YouTube for example) as inline breaks fancybox for Drupal 6 (latest jquery). The fancybox window hangs at the standard width and height and the video is kinda cut off.

Anybody with that issue too? Or an idea how to fix that?

Using the latest version jancor posted earlier and modifying the frame width and height it seems to work.
But on the modules page i receive this error:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /sites/all/modules/fancy_box/fancy_box.module on line 76.
I have none of the optional modules he mentioned installed which could be be the cause of this error message.

It works! Thanks mate!

dboulet’s picture

43.41 KB

Here's an updated version of the module posted in #13. I've cleaned up the code—adjusting it to conform to Drupal coding standards—and attempted to fix small bugs, such as the one brought up in #19.

perandre’s picture

Tested and works as expected. Thanks!

I confirm that Under Advanced settings, all headings for the input fields say "Padding".’s picture

34.06 KB

still no official D6 release?

I've added two necessary hooks to use this module with Insert module, formerly known as filefield-insert module.

More info about the hooks: #479310: Add support for add'l CCK Formatters (Lightbox2, etc.)

perandre’s picture

Thanks,; will test!

FortEZ’s picture

I have just installed fancybox to test it with Drupal 6. It seems that the fancy box does not resize properly to fit my video's size (the problem is cross browser). Can anyone confirm this? Is there something
that I have to change in the css file?

Note: I just noticed that this happens only for video objects. Images work normally. I have used the same method to launch my fancy box like the one that is used here. It is the same problem that is mentioned in #19. However there is a:

modifying the frame width and height it seems to work.

comment there. Can you please specify what do you mean by this? How do you modify the frame width and height?

I also confirm that Under Advanced settings, all headings for the input fields say "Padding".

Dave Reid’s picture

Posted from

Is there a reason we should support the module being taken over when there are better alternatives in an already crowded group? I'd prefer to just mark this module as abandoned point them to the comparison page so they can choose which module they want to use.

Please let me know in how this module differs from the many existing and well-established lightbox modules.

jsm174’s picture

Hello again, I'd like to put another patch together and help get this module in for D6.

Initially I had a D6 version in posted in #4. Jancor posted another version in #13 and #14. I don't think this version started with #4, since it doesn't support a dynamic overlay color and there have been a few comments saying the admin settings all say "padding". I checked and #4 did have correct titles. I think all the remaining patches were started with #14.

So anyway, it seems like we could merge #4 and #22?. Since there were a few GPL comments, we could put the new 1.2.5 version of Fancybox in the libraries folder? Also could we use fancybox instead of fancy_box? This would stay more inline with name of the plugin?

-- Jason’s picture

Jason, ximo has a little bit different version than the one attached here. He said he will commit it these days so we should wait just a little bit more :)

jsm174’s picture

Ok. Cool. I'm still going to look into the libraries part. :)

I just want to make sure we can get all the admin enhancements that were done in #4 back in.

It fixed #17, 18, etc. :)

localhost’s picture


youkho’s picture


espenmoe’s picture


Hummer’s picture

Under sites/all/modules/fancy_box/plugin in the jquery.fancybox.js scroll all the way to the bottom. You'll see it.

And thanks for the bugfix! #20

liquidcms’s picture

60.86 KB

i guess i should have looked in the issue queue.. saw there was no D6 version.. so i ported it this evening.

i am sure the one posted above is much better.. but i added small addition which auto grabs one imagecache preset size from the initial rendered image and uses another icache preset for the fancybox image - both preset values are defined in the fb admin form.

i'll attach my version here and maybe maintainers might find the small JS addition useful.

klonos’s picture


iLLin’s picture

Wow the author really needs to step up here and get this organized. What a mess... custom it is.

Babalu’s picture

it would be great that i can use fancybox with fields e.g. embedded media

momendo’s picture

Status: Active » Needs review

+1 on D6 version. I am willing to test.

Daniel Wentsch’s picture

Subscribing. Thanks for the d6 ports!

mariomaric’s picture


any news of official D6 release?


saurabh.bhambry’s picture

Could anyone give some pointers as to how I can use the module dat has been posted here. Thanks.

AdrianB’s picture

Is there active development going of this module for D6? Since the switch of maintainers it has been quite for a while, so I'm just curious.

jcisio’s picture

Priority: Normal » Critical
Status: Needs review » Active

Just tried and love the lightweight but beautiful fancybox. The maintainers can just put a working and well tested version above on the 6.x branch so that we can submit patches?

liquidcms’s picture

for #33 above.

url example (click img):
screen of node display:
screen of fancybox config:

i think thats it; specify icache preset to use for your image field, set that same icache in fbox config, set 2nd, larger icache preset in fbox config.. should be about it.

Peter Lindstrom
LiquidCMS - Content Solution Experts

Alan D.’s picture


I tried out the ported module from #33 and I found it a little bit strange and restrictive. I'm reworking it from scratch and I was wondering if you are interested in this UI / functionality:

Default settings

* General settings page:
Default FancyBox settings + enabled flag & classes textfield (comma seperated list of classes)

* Implementation:
A link with one of the defined classes.

* Manual usage
These both are triggered by having the FancyBox class trigger set to "imagecache-medium_imagelink fancybox"

    // $image is an ImageField item
    $alt = empty($image['data']['alt']) ? $type : $image['data']['alt'];
    $title = empty($image['data']['title']) ? 'test' : $image['data']['title'];
    $img = theme('imagecache', 'left_block_full', $image['filepath'], $alt, NULL);
    return l($img, imagecache_create_path('large', $image['filepath']), array('html' => TRUE, 'attributes' => array('class' => 'fancybox', 'id' => 'id-'. $node->nid .'-'. $image['delta'], 'title' => $title)));

* CCK integration
This is using the class 'imagecache-medium_imagelink' that is automatically generated via CCK when using the Display option "Medium image linked to Image".

To get any ImageCache preset that is linked to an image, add the class "imagecache-imagelink" to the trigger list.

ImageCache integration (Not done yet)
Default FancyBox settings + enabled flag, optional classes to restrict, & ImageCache target preset

* Settings
Hook into the imagecache preset form

* Implementation
Find all images that are created via this preset and wrap these with a trigger to go to the specified preset.

* Reason for this one
To bypass the no-JScript link to the image, forcing either Nothing or the Lightbox

I'm going to look at rewriting some of the code inside FancyBox to include some of the newer features such as title callback and title position [or look at backporting the latest version to work with JQuery]

Anyway, love to know your thoughts’s picture

there is a new version on we are developing, I hope next week we'll push it here

Alan D.’s picture

39.47 KB

Cool. I'll attach the zip of what I wrote this morning. As far as I can tell, the first part described above is production ready with the exception of cross-browser testing. First cut, so it can use some refactoring. The code was built with the new fancybox / jquery version in mind, and has partial methods for 1.3 that requires jquery 1.4 / Drupal 7 :)

It still contains the original JScript as I wrote it prior to looking at the other issues. The fancybox.js has a slight modification that accepts a title callback JavaScript function OR a title attribute (which is not applicable ready using global settings) This has no bearing on the module, but I have used this for an AJAX title callback to populate the title caption with HTML

Are you developing from CVS? I'd love to have a peek at the direction that you are taking


Darinka’s picture

I would also like to contribute with my findings.

I am using Fancybox with Imagecache. I allowed the imagecache images to have an ALT text.

I wanted to display the image's alt text inside the fancybox caption. This is how I did it (in fancybox.module,v on line 18):

          $("a'.variable_get('fancybox_class_id', '').'").each(function(){
      ... ... ...

Hope this helps somebody if interested.

klonos’s picture

So excited this is finally getting some love!!!

't was 'bout time!

Alan D.’s picture

I was going to offer to become a contributor / maintainer, but it looks like there is some progress happening? (as per #45)

I spent a couple of hours looking for lightboxes on the web and this one did seem like one of the better ones, but the Drupal 5 implementation just didn't work for my requirements.

The version I wrote above in #46 is a generic implementation of the plugin with a complete Drupal interface for all settings available in the plugin. This is a completely independant implementation of the module that has no relationship to the original project.

Looking back at it, I think that it needs an advanced jQuery selector option too for users. My implementation was class based targeting only, 98% of use cases. Maybe I'll add another import field that accepts any JQuery selector, (like in an advanced settings fieldset or something), but if the module is being developed independently...

Alan D.’s picture

43.08 KB

Using my version at work, the project is due. So here is a tidied up version, has (untested) the old imagecache support, class based "a img" targeting and darinka suggestion for using the image alt. It tries to grabs the first img alt text, then the img title and falls back to the anchor title. This is a global configuration option [edit: for the new a.class img selectors only].’s picture

We are almost ready, in few days I'll commit new version and make a dev release so stay tuned! :)

klonos’s picture

Great news!!

dboulet’s picture Really? We've heard that before (see #7). ; )

rwohleb’s picture

Looking at #623664: Non-GPL code included in Fancybox CVS folder, you got CVS access in December. Why are you still developing via LaunchPad? I know I'd at least like to get my hands on a broken build through D.O. Also, if I'm looking at the right LP project (, it shows ZERO commits in the last month. Can we get more of an update than 'coming soon'?’s picture

Status: Active » Fixed

Initial version is in the CVS. I've created dev release, will show up when the packaging script runs

saurabh.bhambry’s picture

Title: Drupal 6 version » Suggestion
Version: 5.x-1.x-dev » 6.x-1.x-dev

I just have a suggestion while the development is still on. It would be great if Fancybox integrates with Views like Lightbox does.

saurabh.bhambry’s picture

Category: task » support
Priority: Critical » Minor
Status: Fixed » Closed (fixed)

The above got posted as an Issue by mistake. Please excuse me for the mistake’s picture

Status: Closed (fixed) » Fixed

Il take a look at Views integration, please open new task

dboulet’s picture

Title: Suggestion » Drupal 6 version
Version: 6.x-1.x-dev » 5.x-1.x-dev
Category: support » task
Priority: Minor » Normal

Hooray! Thanks

klonos’s picture

Priority: Normal » Critical Thank you for all your hard work!

@dboulet (referring to #53): see? and you thought they were only words ;)

anyways... on to testing and suggestions/bug reports.

klonos’s picture

PS: I am about to post a few issues. Don't freak out by the number of issues, they'll only serve as a to-do list and related work/patches/issues can be posted there.’s picture

Just do it :)

klonos’s picture

#742696: Views integration takes care of #56 and #58 ;)

Status: Fixed » Closed (fixed)
Issue tags: -fancy box

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