Chapter 16. Development Hooks

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • The top eight Drupal hooks, which allow you to:

  • Create custom pages

  • Add custom permissions

  • Act upon user activities such as new account creations

  • Create custom filters for use in text formats

  • Modify your site's forms

  • Making your modules translatable

  • Adding theming functions to your modules

The previous chapter provided an introduction to Drupal module development, but this chapter dives into the subject. If you are a seasoned developer new to Drupal or simply ready to dive straight into the subject and get to the heart of development, this is the chapter for you. This chapter explains how to use the most common Drupal hooks and theming tasks. In researching this book I wrote a script that analyzed over 2,300 stable modules for Drupal 6, the most active and well-used version of Drupal to date. From this list I chose the top eight most common hooks to introduce you to in this chapter.

These hooks allow you to create custom pages, add administrative settings, custom permissions, new blocks, act on user activities, create custom filters, and modify any of your site's forms. I was pleasantly surprised to find that hook_help also made it into the top eight, a hook that provides helpful documentation to your site users.

Why eight? Actually there are over ten. The ninth is hook_theme, which is introduced in the theming portion of this chapter. 10, 11, and 12 are hook_schema, hook_install, and hook_uninstall all of which are used for ...

Get Beginning Drupal® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.