Free Sample
+ Collection

Learning Drupal 6 Module Development

Matt Butcher

A practical tutorial for creating your first Drupal 6 modules with PHP
RRP $23.99
RRP $39.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781847194442
Paperback328 pages

About This Book

  • Specifically written for Drupal 6 development
  • Program your own Drupal modules
  • No experience of Drupal development required
  • Know Drupal 5? Learn what's new in Drupal 6
  • Integrate AJAX functionality with the jQuery library
  • Packt donates a percentage of every book sold to the Drupal foundation

Who This Book Is For

This book is written for PHP developers who want to add custom features to Drupal. You will need to know the basics of PHP and MySQL programming, but no experience of programming Drupal is required, although you will be expected to be familiar with the basic operation of Drupal.

Table of Contents

Chapter 1: Introduction to Drupal Modules
Drupal's Architecture
Crucial Drupal Concepts
Developers' Tools
A Word on Our Demonstration Site
Chapter 2: Creating Our First Module
Starting Out
A Basic .module File
Installing a Module
Using Goodreads Data
Finishing Touches: hook_help()
Chapter 3: The Theme System
The Theme System's Architecture
Creating a Custom Theme
Chapter 4: 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
Chapter 5: Using JavaScript and AJAX/JSON in Modules
Picking up Where We Left Off
Introducing jQuery
Writing a Drupal AJAX/JSON Service
Chapter 6: 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
Chapter 7: 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
Chapter 8: 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
Chapter 9: An Installation Profile
Introducing Installation Profiles
Setting up a Distribution
Programming Profiles
The .profile Script
The Installation Task System
Packaging the Distribution

What You Will Learn

  • A developer's overview of important Drupal concepts and APIs, like nodes, menus, and forms
  • Using Drupal tools for module development
  • Creating a new module from scratch
  • Harnessing the power of the Drupal hook system
  • Using key Drupal functions
  • Creating custom content types, from basic to advanced
  • Performing database operations
  • Writing module installers and uninstallers
  • Making Drupal content available to JavaScript with a JSON service
  • Interacting with the theme system to build crisp layouts
  • Creating richer user interfaces with Drupal's JavaScript libraries
  • Working with blocks, nodes, actions, and menus
  • Using a web service to retrieve and display XML data
  • Creating an administration interface
  • Customizing user profiles
  • Writing actions and triggering them with events
  • Working with the Forms API
  • Defining custom hooks and making modules work together
  • Exploring the database and schema API
  • Creating an installation profile to bundle your modules into a custom Drupal distribution

In Detail

With great power comes... tremendous flexibility. Drupal is an award-winning open-source Content Management System, and the feature-packed sixth release is right around the corner. It's a modular system, with an elegant hook-based architecture, and great code. These are a few of the perks that make Drupal a choice platform for developers who want the power of an established CMS, but the freedom to make it work for them. From social networking to AJAX to e-commerce, the hundreds of existing modules attest to Drupal's flexibility. When you create a new module for Drupal, it fits seamlessly into the look and feel of your overall site. If you can think it in PHP, you can code it as a Drupal module.

Dive into Drupal module development as we create the Philosopher Biographies website, developing new modules and themes to meet practical goals. Create custom content types. Add AJAX functionality with the jQuery library. Use external XML APIs to add content to your site. Email newsletters to site members. Use themes. Empower administrators with extra features. And bundle it all up in a custom installation profile. You won't find a "hello world" here!

If you're eager to start creating modules for Drupal 6, this is your book. Walk through the development of complete Drupal modules with this primer for PHP programmers. Specifically written for Drupal 6, this book will get you coding modules as quickly as possible, and help you add the features that will give your work that professional gloss!

Just getting started with Drupal development? This book will give you a clear, concise and, of course, practical guidance to take you from the basics of creating your first module to developing the skills to make you a Drupal developer to be reckoned with.

Are you a Drupal developer looking to update to version 6? This book covers the new and updated APIs to guide your transition to Drupal 6. The new menu system, the Forms and Schema APIs, and many core revisions are covered in this book.


Read More