How to make a module in Drupal. To see the "official" DrupalCon Paris video of me giving this presentation, check this out: http://technosophos.com/content/how-make-module-video
4. Our Goal
Build a Drupal module from
scratch in 40 minutes or less.
5. Our Module
• One directory and two files.
• Using Drupal’s hook system.
• Add a new block that can be placed in one
of the block regions.
• Add a new “page” (menu callback).
6. Begin with...
• Module directory:
paris/
• Two files: module_name.info
• paris/paris.info
module_name module_name.*.inc
module_name.install
•
and others.
paris/paris.module (optional)
module_name.module
7. The Info File
• Contains information • Used by module system
about a module to learn about the
module
• Plain text config file
8. The Module File
• Contains PHP code
• Hook implementations
live here
• Often, other supporting
code is here, too
• Drupal loads this
automatically
9. Hooks
Drupal looks for
particular function
patterns in module files.
Functions that conform to
these patterns are called
“hook implementations”.
http://www.flickr.com/photos/39321672@N07/3616749186/