PacktLib: Learning Drupal 6 Module Development

Learning Drupal 6 Module Development


About the Author

About the Reviewers


Introduction to Drupal Modules

Drupal's Architecture

Crucial Drupal Concepts

Developers' Tools

A Word on Our Demonstration Site


Creating Our First Module

Starting Out

A Basic .module File

Installing a Module

Using Goodreads Data

Finishing Touches: hook_help()


The Theme System

The Theme System's Architecture

Creating a Custom Theme


Theming Modules

Our Target Module: What We Want

Creating a Custom Content Type

The Foundations of the Module

A Simple Database Lookup

Theming Inside a Module

Overriding the Default Theme from a Theme


Using JavaScript and AJAX/JSON in Modules

Picking up Where We Left Off

Introducing jQuery

Writing a Drupal AJAX/JSON Service


An Administration Module

The emailusers Module

The Beginning of the Module

Registering an Administration Page

Handling Forms with the Forms API (FAPI)

Sending Mail with the Mail API

Incorporating the Module into Administration


Building a Content Type

The biography Module

The Content Creation Kit

The Starting Point

The Module Installation Script

Correlating the New Table with Nodes

The Content Creation Form

Access Controls

Database Hooks

Hooks for Getting Data

Theming Biography Content


Filters, Actions, and Hooks

The sitenews Module

Getting Started

A Simple Content Type, Defined in Code

Creating Filters and an Input Format

The Beginning of an Action

Defining a Hook

Completing the Action: Theming and Mailing

Adding a Trigger


An Installation Profile

Introducing Installation Profiles

Setting up a Distribution

Programming Profiles

The .profile Script

The Installation Task System

Packaging the Distribution