I'm in the process of extending jQuery Multi module. Libraries API libraries was built in, I have already added support for JavaScript libraries provided by modules, so with minimal cooperation on the side of modules' authors I have that part covered. Now time to add themes to the list - and I'm stuck.

I found no way to make a theme use hook_library() and by the API docs it's a module hook, so I can't use method I used for modules.

I can use list_themes() to list themes, but how to see a JS files?

  • I hope to see alternatives. Module's way of exporting libraries would fit my needs way better. – Mołot Oct 8 '13 at 7:19

list_themes() returns an array of objects:

The keys are the themes' machine names and the values are objects having the following properties:

  • scripts: An associative array of JavaScripts, using the filename as key and the complete filepath as value. Not set if no scripts are defined in the .info file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.