PacktLib: Learning Drupal 6 Module Development

Learning Drupal 6 Module Development

Credits

About the Author

About the Reviewers

Preface

Introduction to Drupal Modules

Drupal's Architecture

Crucial Drupal Concepts

Developers' Tools

A Word on Our Demonstration Site

Summary

Creating Our First Module

Starting Out

A Basic .module File

Installing a Module

Using Goodreads Data

Finishing Touches: hook_help()

Summary

The Theme System

The Theme System's Architecture

Creating a Custom Theme

Summary

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

Summary

Using JavaScript and AJAX/JSON in Modules

Picking up Where We Left Off

Introducing jQuery

Writing a Drupal AJAX/JSON Service

Summary

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

Summary

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

Summary

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

Summary

An Installation Profile

Introducing Installation Profiles

Setting up a Distribution

Programming Profiles

The .profile Script

The Installation Task System

Packaging the Distribution

Summary