-
Book Overview & Buying
-
Table Of Contents
Learning Drupal 6 Module Development
As mentioned in the first chapter, there are two files that every module must have (though many modules have more). The first, the .info file, we examined above. The second file is the .module (dot-module) file, which is a PHP script file. This file typically implements a handful of hook functions that Drupal will call at pre-determined times during a request.
For an introduction to hooks and hook implementations, see the previous chapter.
Here, we will create a .module file that will display a small formatted section of information. Later in this chapter, we will configure Drupal to display this information to site visitors.
For our very first module, we will implement the hook_block() function. In Drupal parlance, a block is a chunk of auxiliary information that is displayed on a page alongside the main page content. Sounds confusing? An example might help.
Think of your favorite news website. On a typical article page, the text of the article...
Change the font size
Change margin width
Change background colour