Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Like this? Share it with your network


How to Build a Drupal Module



This is a short and simple presentation directed towards beginner Drupal developers, explaining how to build a simple custom module for Drupal. More information can be found here:...

This is a short and simple presentation directed towards beginner Drupal developers, explaining how to build a simple custom module for Drupal. More information can be found here:




Total Views
Views on SlideShare
Embed Views



6 Embeds 761

http://www.opensourcecatholic.com 685
http://www.drupalarabic.com 69
http://drupalarabic.com 3
http://static.slidesharecdn.com 2
http://drupal.org 1
http://translate.googleusercontent.com 1



Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

How to Build a Drupal Module Presentation Transcript

  • 1. Building a Module - the Basics Jeff Geerling - Archdiocese of St. Louis, Midwestern Mac, LLC October 28, 2010
  • 2. Jeff Geerling - Quick Bio ✤ http://drupal.org/user/389011 ✤ Web Developer for Archdiocese of St. Louis (archstl.org, stlouisreview.com, stlyouth.org, 10 other Drupal sites) ✤ Owner of Midwestern Mac, LLC (midwesternmac.com) (work on other Drupal projects in my spare time) ✤ Personal site: www.lifeisaprayer.com (Drupal since 2009)
  • 3. Getting Set for Success ✤ Turn on Error reporting, check your logs admin/settings/error-reporting admin/reports/dblog ✤ Install Devel module, always clear caches (admin_menu is helpful) ✤ Have the Drupal API handy (api.drupal.org) ✤ Drupal handbook also good: http://drupal.org/node/206753 ✤ Learn how to use your editor - TextMate, Coda, BBEdit... vim, etc. ✤ 2+ cups of coffee, Red Bull... pick your poison
  • 4. Core Components of a Module ✤ .info File ✤ Stores metadata about the module - description, name, dependencies, etc. ✤ Only requirements: name, description, core ✤ More: http://drupal.org/node/231036
  • 5. Core Components of a Module ✤ .module File ✤ Contains the code for your module ✤ This file can sometimes be tiny, sometimes huge - it depends on your module’s purpose ✤ Often, you will reference external .inc files or templates (so you don’t have a huge, messy .module file)
  • 6. Let’s Make a Module ✤ Simple: “custom” module ✤ I have one of these on almost every website I run. ✤ Make ‘custom’ folder inside: sites/all/modules ✤ Add two new files: custom.info custom.module
  • 7. custom.info
  • 8. custom.module
  • 9. custom.module - demo
  • 10. Gallery Archive - Contrib module ✤ http://drupal.org/project/gallery_archive ✤ Wasn’t planning on contributing the module at first ✤ Community’s given so much to me, though, so I thought I’d contribute back ✤ Contributions, reviews, and helpers are what make Drupal awesome ✤ If *you* don’t contribute, who will?
  • 11. Gallery Archive - demo
  • 12. More Resources ✤ Drupal Coding Standards: http://drupal.org/coding-standards (It’s good to use standards regardless, as it makes your code easier to grok (understand) for other developers...). ✤ Module Developer’s Guide: http://drupal.org/developing/modules ✤ Examples for Developers: http://drupal.org/project/examples (A module that shows how to implement different APIs - great for training on how to manipulate core to do your bidding). ✤ Drupal API: http://api.drupal.org/ ✤ DrupalContrib: http://drupalcontrib.org/ ✤ Stack Overflow: http://stackoverflow.com/ ✤ Drupal hooks: http://api.drupal.org/api/group/hooks/6