This tutorial describes how to create a module for Drupal 7. If your goal is to convert a module from Drupal 6 or earlier to Drupal 7, see: Updating your modules.
A module is a collection of functions that link into Drupal, providing additional functionality for 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.
This tutorial assumes you have:
- Basic PHP knowledge, including syntax and the concept of PHP objects
- Basic understanding of database tables, fields, records and SQL statements
- A working Drupal 7 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 necessarily prepare you to write modules for public release. It does not cover important topics such as: caching, permissions, or security issues. Use this tutorial as a starting point and then extend your skills with other resources, including:
- Examples for Developers, modules written specifically to illustrate various aspects of Drupal development with verbose comments
- Other modules, including contrib and core
- Drupal documentation
- Writing secure code
- Coding standards
When you are finished developing a useful module, you may want to contribute it back to the community. If so follow the instructions for: creating a new full project.