Creating a Drupal Module — Part 2: The .info File

The .info file is a simple, plain text file describing your module. This information is read by Drupal and displayed on the module administration page (Administer > Site building > Modules). Without this file, you module will not show up in the list of available modules.

Your testmod.info file will look like this:

; $Id$
name = My Test Module
description = This is my first Drupal module. Hello world!
core = 6.x

Fill the appropriate information for your module. Just a few notes:

  1. The $Id$ comment is required on all module files (see related PHP note on the next page). It must be the first line in the file.
  2. Do not use line breaks in your description. Supposedly having line breaks will cause the file to not be parsed properly.
  3. Core describes which version of Drupal this can be used on. Your Drupal installation will not run the module for versions on that that which is specified here.

There are several other fields which can be defined in this file, but we will not need them for our module. For detailed information about this file, visit the Drupal tutorial, here.