Creating a simple module
Whole books are written about Drupal module development. This chapter is just a brief introduction to a very complex subject, to get you started.
Table of contents
Introduction
This chapter is based upon Matt Butcher: Learning Drupal 6 Module Development.
The full text (MS Word) is in the subdirectory goodreads
.
This chapter outlines how to create a simple Drupal 7 module. We shall make use of an existing web service to pull in some XML data, format it, and display it as a block in the site's layout. These topics will be covered:
- Creating the
.info
and.module
files. - Creating a new module.
- Using basic hooks.
- Installing and configuring the module.
- Using some important Drupal functions.
You can download the code of this project from Drupal.org:
$ git clone --branch 7.x-1.x http://git.drupal.org/sandbox/gisleh/2226115.git inf5272 cd inf5272
The code is in the subdirectory goodreads
.
This particular module will fetch XML-data from the website
http://www.goodreads.com
and display it in a block on our site. It does
not interact with the database, so there is no need for an
.install
-file to set up a schema.
Final word
[TBA]
Last update: 2013-02-23 [gh].