Drupal Tutorials : Drupal Module Development

I rarely do any heavy structural changes to node edit pages, so until today I hadn’t ever had a reason to disable vertical tabs on a specific content type, but there’s a first time for everything.

Now there are people who recommend turning it off by editing the $conf variable in the settings.php file… however, this is not an option on this particular site since it is running on Aegir, which automatically rewrites the settings.php file. So I had to find another way. I took a look at the vertical tabs code and came up with an easy solution.

As of the date of this writing views 2 for Drupal does not have a canned method of accepting multiple arguments that are CCK fields. The case where this came up for me was in a CCK select field that had dynamically generated options (created through php). The options were years, and the user was allowed to chose multiple years. How then, can one set a view to dynamically filter for content that had been marked with at least one of the years sent in the argument?

When you want to create a list of years as a select field in CCK ranging from some set date in the past to the current date you have a couple of options. The first option would be to go through and manually enter every year from that date to present. This may be ok if you only are working with a date range of 3 or 4 years, but what if you want to list the years since the 1800s. Obviously that list would be painful to make, and what’s worse you would have to make sure the site was updated every year by someone competent enough not to destroy the information.

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:

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: