jQuery Plugin Integration

Events happening in the community are now at Drupal community events on www.drupal.org.
digerati's picture

Hey all!

This may be extending Chris's previous question regarding slideshows, but may take it more in the javascript direction. I too have been looking for a way to create some unique slideshows, with a few certain requirements.

I would like to display a large slideshow on the homepage, with different thumbnail images below it on a carousel that would allow the user to pick the image they would like to have displayed in the slideshow. I found a jQuery plugin that seems to fit the bill, although it is lacking the lightbox style zoom (this may be impossible) that I would love to include as well.

Here is a demo of the JQuery plugin GalleryView with its default implementation.

Currently in production is a Views Slideshow JCarousel Thumbs navigation that might work as a 'Drupal ready solution', but looks as though it is still pretty fresh and getting the kinks worked out.

I am lost when it comes to integrating this GalleryView jQuery plugin into Drupal. I have read on and installed jQP and jQ, but the process of adding these libraries just isn't clicking with me. It seems that this may be a complicated issue, but it also seems that once a small amount of heavy lifting is done, implementing a jQuery plugin may be quite a useful resource involving other javascript libraries down the road.

If anyone out there can either:

A.) Break down at a higher level what is going on by integrating these libraries, as well as calling them with the drupal_add_js_library('jquery.jqGrid') function.

or

B.) Explain the detailed process of uploading, installing, accessing and implementing an external jQuery plugin such as GalleryView.

it would be much appreciated!!

Thanks in advance!

-Brett

Comments

drupal_add_js

scottrouse's picture

Brett,

Great questions (and good timing, as we'll likely be doing a photo gallery/slideshow meetup this week).

I'll try to answer your questions as best I can, but hopefully Andy will chime in with some higher-level API chatter.

First of all, I don't believe there is a drupal_add_js_library() function. The related function is drupal_add_js(). Details for that are available at http://api.drupal.org/api/function/drupal_add_js. To implement that, you'd basically write a simple module which calls that function allowing you to include the jQuery GalleryView plugin code.

Check which minimum version of jQuery is required/recommended (looks like v1.2.1). It may be helpful to use the jQuery Update Module in your installation.

The easy answer, however, is that you just need to save the required .js files in your site installation somewhere and call them in page header (or footer) on the page(s) which will have the slideshow(s). Then just theme the View to match the required naming conventions from the GalleryView plugin.

Not sure if that makes any sense...This would be a good one to talk about this week.

-Scott

Western Montana

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week