Code for Contrib: When There's Not a Module for That

Presented by

Track: 
Coding and Development

You won't understand everything about module development this hour, or this week, this month, this year, or this decade.

That's why the approach here is to learn how to learn. Not simply, this is what , but what investigation or resource or secret guild of wizards was needed to gain that knowledge?

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 shows 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!

In the context of a couple real examples, we will cover these APIs:

  • form_alter – if you learn one hook, let this be it. 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 abstraction layer, aka DBTNG
  • taxonomy – yup, de-opped too, and made into fields...
  • field – yeah this is the big D7 deal
  • Making your own fieldable entities.
  • Theme and render.

The methods and tips in this session will be based on the real work of figuring out how to do specific things with Drupal. 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.

This session will focus on code, but will carry forward the wide approach with tips on being a celebrated and sane module maintainer.

Intended Audience

Developers looking to improve their module development processes, to get up to speed on (more of) Drupal 7, or to heckle.

People with a module they've written and want to make better before contributing.

Anyone serious about learning Drupal 7 module development.

Configurators who have realised they need to write some custom code or fill in some missing pieces to take their project to the next level.

Questions the session will answer

  1. How do I write a module that plays well with Drupal core and other modules? (hint: uses lots of hooks)
  2. How do I make a module is extensible by other modules? (hint: defines its own hooks!)
  3. How do I make my module easy for users and administrators to use and developers to understand? (hint: contextual links, help, coding standards)
  4. 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?
  5. How do I learn things that aren't covered in this session? How do I find answers in other people's code?

Experience level: 
Intermediate
Time slot: 
18 May 14:30 - 15:30