jQuery Plugin Handler (JQP)

Drupal Modules - Tue, 30/09/2008 - 8:18pm

(Yet another) jQuery plugin module. This module aims to be a simple, lightweight, and easy to use jQuery plugin handler for Drupal 6.

Why do I need a manager/handler for your jQuery plugins?

If you have a module that is using a jQuery plugin, the usual reaction is to drop the plugin into the module directory and be done with it. However, this becomes a big problem when you have two different modules which use the same plugin. At minimum, the library will be included on the page (and downloaded by the browser) twice. At maximum, conflicting versions or multiple initializations of the same plugin can cause major problems for the page.

A plugin manager/handler will place all of your jQuery plugins in a central location so there is no duplication or conflict.

My frustration with the other jQuery plugin managers (such as JQ and Plugins) was that they required you to write a lot of PHP code just to have central access to a jQuery plugin. Each jQuery plugin got represented by a separate module and the overhead as compared to "just dropping it in my module directory" was frustrating.

To use JQP with your module or theme:

  1. Enable the module.
  2. Create a directory called "plugins" at sites/all/plugins or sites/[example.com]/plugins or similar.

read more