Community Documentation

Creating modules - a tutorial: Drupal 4.6/4.7

Last updated December 17, 2008. Created by semma on February 24, 2005.
Edited by redndahead, ax, brainless, webchick. Log in to edit this page.

This tutorial describes how to create a module for Drupal 4.6 or 4.7. It is an update to the tutorial for Drupal 4.3. Please see comments there, also. Most of this tutorial is valid for Drupal 4.7 as well, but you should check the API documentation, as well as the documentation on how to update your modules from one version of Drupal to another.

A module is a collection of functions that link into Drupal, providing additional functionality to your Drupal installation. After reading this tutorial, you will be able to create a basic block module and use it as a template for more advanced modules and node modules.

This tutorial will not necessarily prepare you to write modules for release into the wild. It does not cover caching, nor does it elaborate on permissions or security issues. Use this tutorial as a starting point, and review other modules and the Drupal handbook and Coding standards for more information.

This tutorial assumes the following about you:

  • Basic PHP knowledge, including syntax and the concept of PHP objects
  • Basic understanding of database tables, fields, records and SQL statements
  • A working Drupal installation
  • Drupal administration access
  • Webserver access

This tutorial does not assume you have any knowledge about the inner workings of a Drupal module. This tutorial will not help you write modules for versions of Drupal earlier than 4.5.

About this page

Drupal version
Drupal 4.6.x, Drupal 4.7.x

Archive

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here