Book Image

Learning Drupal 6 Module Development

By : Dries Buytaert, Matt Butcher
Book Image

Learning Drupal 6 Module Development

By: Dries Buytaert, Matt Butcher

Overview of this book

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

Hooks for Getting Data

We're getting close to the end, now. We have only three more functions to go.

So far, we've created an installer, implemented hooks to create the database tables, implemented access controls, created a form, and developed functions for maintaining our custom tables.

In this section, we will look at functions used for accessing our content. And once again, we will be moving back toward the familiar. We will start by implementing hook_load(), then we will take a look at hook_view() and hook_theme().


In the subsection Getting the Node's Content in Chapter 4, we used the function node_load() to load the contents of a node. That function is an implementation of hook_node(). In that chapter we also looked carefully at adding theme support to a module, covering hook_theme() as well.

Loading a Node with hook_load()

The hook_load() hook provides a chance for extended content types, like the one we are creating, to load additional data. This extra information is combined with...