Building our module
Modules are built up of a number of different files:
Installation files: These files contain code which is executed when a module is installed and uninstalled
Info files: These files contain basic information about the module, including the name and Drupal core they are compatible with
Module files: These files contain the logic behind the module
Optional templates: These files are used to override the layout and design of the pages (suggestions)
For each module we want to create we need to create some, if not all of these files. Detailed documentation for them is available on the Drupal website:
Install files: http://drupal.org/node/876250
Info files: http://drupal.org/node/542202
Template suggestions: http://drupal.org/node/1089656
Let's get started with building our modules, and begin by creating the relevant .install
files.
Installation files
When we enable our modules, Drupal will automatically look for an .install
file to run as part of the module installation process...