Libraries API module


As much as I love Drupal sometimes the documentation of them or module developers does not have detailed description.

Today I struggled with the Libraries API module and the simple setup of an info file for my library. I wanted to add the jquery.scrollTo plugin and followed the documentation saying:

You can do this either by implementing hook_libraries_info() in your module or by providing an info file for your library, which users then have to download. The info file should be in the same format as a regular Drupal info file for a module or theme, and should contain exactly the same keys that are described in hook_libraries_info().

The key for the JavaScript files for example would be "js". Instead you need to add to your info file "files[js][]".

The following example demonstrates the info file of the scrollTo plugin:

title = "jQuery ScrollTo"
website = ""
version = ""
files[js][] = jquery.scrollTo.js

The last thing you have to consider is the naming rule for the info file. =>

Where your info file needs to be in the main library folder and the LIBRARY_NAME is a subfolder.

Drupal 7
info files