This document is intended for module developers who wish to make use of JQuery to process an array of hierarchical data into a click and expand menu. It is written with the assumption that you are a programmer and that you know how to create multidimensional arrays through recursive functions.
The only function that third party modules need to call from JQuery menu in order to create a click and expand menu is as follows:
theme(‘menu_creation_by_array’, $menutree, $trail);
This calls the theme function menu_creation_by_array() and sends it two arguments:
Want to be kept informed whenever new content is added to Pixel Clever? If so you can subscribe to the RSS for the whole site, or for particular subjects that interest you. Below is a listing of feeds that you may find useful.
The Pixel Clever Blog feed: News, Announcements, commentary on Drupal, project management and on technology in general.
Drupal hit it big when version 5 came out. Before this time it had a considerable user base, but it hadn’t gone main stream yet. The transition from Drupal 4 to Drupal 5 was extremely quick. No one held on to Drupal 4 and all significant modules released 5x versions within a few months. When Drupal 6 came out last year I think many of us expected the same kind of quick upgrading and transitioning, but alas, and many important modules have taken their sweet time coming out with a 6x release.
If you are asking this question it’s pretty safe to say that you are new to Drupal. After you’ve been dealing with Drupal for a while it’s easy to start thinking everyone knows what you are talking about when you start throwing out terms like “Drupal Modules” and “Drupal Themes”, but the truth of the matter is that to the average Joe on the street this all sounds like gibberish.
Well it took me about 5 days to get it all together and test it, but finally the Advanced Book Block Module is finished!
This module went much more quickly than the Advanced Taxonomy Blocks module due to the fact that I had already worked out the kinks in the JQuery Menu Api by the time I started. Also I lost less time on stupid bugs since I knew what to expect.
If you have been doing web development for any significant amount of time chances are you know how to build a link by hand using the ‘a href=”link/to/some/page”‘ syntax. That method works fine and can even be used inside of Drupal modules, but it is generally frowned upon by the Drupal community. Using the l() function is the Drupal way of building links programmatically, and though it might take some getting used to, in the end you will find that it saves time.
l() is a function that is available anywhere within a Drupal installation. It accepts three arguments: