Hey guys,
I would like to know if theres a module for shadowbox (or an alternative). I would like to create shadowbox for videos(flv's) on my drupal site.
Are there any other ways to do it without installing a module?

thanks guys appreciate your help.

Comments

nospam-dupe’s picture

heres the shadowbox link I'm talking about : http://mjijackson.com/shadowbox/

thanks.

WorldFallz’s picture

I've had luck adding those types of js scripts by simply using the <script> tags on specific pages. If you want it available to all pages of a certain content type, you could load it in the tpl file for the content type. One thing to note, drupal uses jquery based js so sometimes adding non-jquery js will break drupal. Most of the time Ive fixed it by swapping out the scripts "window.onload" statements with the jquery version "$(window).load". Might be worthwhile seeing if you can find a jquery alternative though.

nospam-dupe’s picture

hey wf,
thanks for replying. i'am a drupal newbie, could you help me with code(like which pages to edit) and stuff?
if I need it on all pages, do i need to edit the node tpl or the page tpl?

thanks.

nospam-dupe’s picture

bump...

WorldFallz’s picture

Ok, I took a look at the scripts, and it looks like the author already allows for using it with jquery. I don't have the ability to test it at the moment, but lets see if I can give you the basics to try.

First, if you want it to be available on ALL pages--- and I mean all-- admin pages, user profiles, etc then you put it in the page.tpl.php. I don't recommend that though. This script doesn't look like something you'd use on non-node pages and I wouldn't want to add the overhead to them if not necessary.

So, try the following:

1. download the shadowbox script.

2. copy the shadowbox.css, shadowbox-jquery.js, and shadowbox.js files into your themes directory

3. edit the node.tpl.php in your theme directory

4. in the <head> section before the print statements, add the following:

<?php drupal_add_css ("sites/all/themes/<yourtheme>/shadowbox.css") ?>
<?php drupal_add_js ("sites/all/themes/<yourtheme>/shadowbow-jquery.js") ?>
<?php drupal_add_js ("sites/all/themes/<yourtheme>/shadowbow.js") ?>

5. create a test page and try to use shadowbox, this is a jquery example the author uses:

<script type="text/javascript">

$(document).ready(function(){

    var options = {
        resizeLgImages:     true,
        displayNav:         false,
        handleUnsupported:  'remove',
        keysClose:          ['c', 27] // c or esc
    };

    Shadowbox.init(options);

});

</script>

6. add/change whatever you need to use shadowbox the way you want according to http://mjijackson.com/shadowbox/#usage

This is all a COMPLETE and utter guess and I have no way of testing it ATM so YMMV A LOT, lol. I'll probably want to get this working myself eventually, I'm just under a huge deadline right now for something else so I won't be able to try it out for a while.

Also, I'm sure there's other and perhaps better ways to do this but this is the best I could do for you-- i'm no professional developer, just a drupal hacker and still fairly new at it. This is what *I* would do to try to get it working--- I have no idea if it's the "proper" way.

Perhaps we'll get lucky and someone who knows more about this stuff will chime in....

fusupo’s picture

Curious if anyone has had any success

Pretty much followed the instructions above...kind of sloppily have all my imports hard coded to absolute paths in my page.tpl.php file. Obviously using jQuery adapter(with or without the JQuery Update module), basically implementing as it says on the shadowbox site:

<a href="myimage.jpg" rel="shadowbox">My Image</a>

finding two problems:

1. doesn't work if I got animation option set to true...i get an error in my firebug: e[prop[p]] is not a function
pretty sure that has something to do with jQuery.
2. when i try to make a 'gallery', my shadowbox breaks...doesn't load anything (although 'loading' shows up)...but throws no errors.

any insight will be much appreciated

deadrich’s picture

I'm having the same exact problem as above. Everything works great if animate is disabled. Of course, that doesn't do much good. If I enable animate option in shadowbox.js, I get the e[prop[p]] is not a function error.

Thanks in advance!

zilla’s picture

i was just reading up on this too - i love lightbox2 for images, but using shadowbox would support youtube links, flickr images, etc - and in a very contained and consistent way.

anybody know what it would entail to write a lightbox2 style module for shadowbox?

fayola’s picture

okay got it to work for me without animation, but still would like it to work with animation checked.

~fayola
--------
http://www.fayola.net

high1memo’s picture

@zilla

I'm currently using the thickbox module (which uses the jquery thickbox script) to do just that.. you can launch any external html site, swf etc in a lightbox style popup window (see it in action at http://www.memo.tv e.g. http://www.memo.tv/eerie_and_drippy ). Though i'm currently looking at the Greybox module, as it seems easier to do (for the Thickbox module you need to link to an iframe etc... but if a hassle... and doesnt animate as nice).

high1memo’s picture

well it currently it seems like the greybox drupal module isn't very customizable from what I've seen. You set the dimensions of the popup in the admin settings page so cant have different settings per popup. Back to thickbox...

WorldFallz’s picture

FYI: http://drupal.org/project/shadowbox for d6.

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

psynaptic’s picture

It's also available for D5 too.

WorldFallz’s picture

Excellent-- great job on the module!!

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz