Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Introduction to Rapid Module Development in Drupal 7

Generic presentation for module development introduction.
by

Jason Smith

on 30 March 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Introduction to Rapid Module Development in Drupal 7

Introduction to Module Development in Drupal 7
Where do I start?
What IS a module?
mymodule.info
mymodule.module

The bare necessities
module.install
module.inc

What's a hook?
Getting hooked
A brief overview of the framework
A module is a collection of hooks
and API calls that act together to
extend or modify core functionality.
Modules are the building blocks that give Drupal its flexibility and power
Some examples:
cck
views
feeds
captcha
panels
localize and/or abstract text - t()
generate site and alias aware links - l()
load, modify and save nodes - node_load(), node_save()
allow theme layer to appropriately display content - theme()
display theme aware notices or error messages to user - drupal_set_message()
render a Form API array*
drupal_render(drupal_get_form('form_id'));
An example module workflow
hook_menu
hook_block_x
hook_node_x
hook_user_x
hook_form_alter
a hypothetical login acknowledgement module
; $Id$
name = "Example module"
description = "Simple example."
core = 7.x
version = 7.x-1.0
package = Views
dependencies[] = views
dependencies[] = panels
http://drupal.org/node/231036
Available core hooks
http://drupal.org/node/212648
Add or modify users - user_load()/user_save()
check for permissions - user_access()
I'm building the "user_login" form. Anyone want to take a look?
cck
views
OpenID
nah
nope
Add these form elements and my callback
Data
get and save simple settings - variable_get()/variable_set()
Drupal is fond of large nested
arrays and objects
$user
$form
$account
$node
hooks & API calls
The module development process
Make sure you really need a module
Make sure someone else didn't already do it
Research the hooks you will need
Research the API calls available
See if a module can provide some of the work for you
Create your module
http://api.drupal.org/api/drupal/includes--module.inc/group/hooks/6
hook_node_load
hook_node_insert
hook_node_delete
hook_node_view
hook_node_*
hook_block_info
hook_block_configure
hook_block_save
hook_block_view
hook_user_insert
hook_user_load
hook_user_login
hook_user_logout
hook_user_presave
hook_user_update
hook_user_view
http://drupal.org/update/modules/6/7
http://drupal.org/project/coder
Full transcript