Book Image

Learning Drupal 6 Module Development

Book Image

Learning Drupal 6 Module Development

Overview of this book

Table of Contents (14 chapters)
Learning Drupal 6 Module Development
Credits
About the Author
About the Reviewers
Preface

Chapter 7. Building a Content Type

In Chapter 5, we created a simple content type using the Drupal administration interface. In this chapter, we will write a module that defines a more complex content type. Doing so will allow us to explore some new APIs including the database and schema APIs. We'll also revisit some of the hooks and APIs we used in the previous chapters.

The module we will create in this chapter will define a biography content type. As we create it, we will perform the following:

  • Create a module installation file

  • Use the Schema API to define a new database table

  • Implement a host of new hooks, mostly from the Node API

  • Use the Database API to execute queries against the database

  • Revisit some already-used APIs and hooks such as the access control hooks and the Forms API

We will start by defining the module's behavior.

The biography Module

The name of our fictional website is "Philosopher Bios". So far, we have created a host of modules, but nothing related to the idea of a biography...