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
About the Author
About the Reviewers

The Foundations of the Module

In the second chapter, we developed a module with the .info and .module files. These files are common to all modules, and we will begin this module by creating .info and .module files.

Our module will be named philquotes, and (as would be expected) will be located in drupal/sites/all/modules/philquotes.

Inside that directory, we will first create a standard module .info file:

; $Id$
name = "Philosophy Quotes"
description = "Dynamic display of philosophy quotes."
core = 6.x
php = 5.1

There should be nothing unfamiliar about the above code. It follows the same format as the module we created in Chapter 2.

Next, we will start our new philquotes.module file:

// $Id$
* @file
* Module for dynamic display of pithy philosophy quotes.
* Implementation of hook_help()
function philquotes_help($path, $arg) {
if ($path == 'admin/help#philquotes') {
$txt = 'This module displays philosophical quotes in blocks. '.
'It assumes the...