DrupalCampNYC 10

Saturday 12 · 10 · 2011

When There's Not a Module for That: Building a Contrib-worthy Drupal 7 Module

Speaker(s): 

Drupal is a powerful and modular system— indeed, much of Drupal's power is in its modules, dynamos of pluggable functionality that can build on Drupal's base system and other modules. This session will show how to add features of your own creation in Drupal 7.

You can write a module yourself. All you need to do is create two files with some text. Once we've dispensed with the myth of module making as the difficult domain of die-hard Drupalistas, we will then go well beyond an easy example, and try to make you a die-hard Drupalista ;-)

This session will draw in part on the module development chapters for the Definitive Guide to Drupal 7 and the X-ray module developed as an example therein; the methods and tips in this session will be based on the real work of figuring out how to do specific things with Drupal. All the same, the invaluable Examples project will be referred to repeatedly. Our goal is that you learn more than this session teaches you: How to keep learning about module development from Drupal core, from the Examples project, from contributed modules, and from all the other Drupalistas out there.

We will cover such APIs as the following:

* form_alter – it's just so much fun
* menu – this is the power of defining our own pages, among other things
* database (the new Drupal 7 database layer, DBTNG)
* node – nodeAPI is de-opped in 7 (it is many focused functions instead of one big switchy/twitchy one, along with taxonomy and user)
* field – yeah this is the big D7 deal
* entity – the lesser known big deal API making fields possible
* help – every module should have it
* theme – because modules have to make themselves themable
* permissions – using and defining

Intended audience:
Anyone serious about learning Drupal 7 module development.

Questions answered by this session:

  • How do I write a module that plays well with Drupal core and other modules? (hint: uses lots of hooks)
  • How do I make a module is extensible by other modules? (hint: defines its own hooks!)
  • How do I make my module easy for users and administrators to use and developers to understand? (hint: contextual links, help, coding standards)
  • How do I know when my module is good enough to ship? Where do I get help making it good enough – and secure enough – to contribute to Drupal.org?
  • How do I figure out how to do what isn't covered in this session? How do I find answers in other people's code?