Book Details

ISBN 139781847194442

Paperback328 pages

Book Description

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.

Table of Contents

Chapter 1: Introduction to Drupal Modules

Drupal's Architecture

Crucial Drupal Concepts

Developers' Tools

A Word on Our Demonstration Site

Summary

Chapter 2: Creating Our First Module

Starting Out

A Basic .module File

Installing a Module

Using Goodreads Data

Finishing Touches: hook_help()

Summary

Chapter 3: The Theme System

The Theme System's Architecture

Creating a Custom Theme

Summary

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

Summary

Chapter 5: Using JavaScript and AJAX/JSON in Modules

Picking up Where We Left Off

I﻿ntroducing jQuery

Writing a Drupal AJAX/JSON Service

Summary

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

S﻿﻿ummary

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

T﻿he Content Creation Form

Ac﻿cess Controls

Database Hooks

Hooks for Getting Data

Theming Biography Content

Summary

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

Summary

Chapter 9: An Installation Profile

Introducing Installation Profiles

Setting up a Distribution

Programming Profiles

The .profile Script

The Installation Task System

Packaging the Distribution

Summary

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

Authors

Matt Butcher

Matt is a web developer and author. He has previously written five other books for Packt, including two others on Drupal. He is a senior developer for the New York Times Company, where he works on ConsumerSearch.com, one of the most traffic-heavy Drupal sites in the world. He is the maintainer of multiple Drupal modules and also heads QueryPath – a jQuery-like PHP library. He blogs occasionally athttp://technosophos.com.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.