2. About Us
●Ipsita Mishra
✔4 years of Drupal experience
✔Tech lead
✔Webadmin & Core member of Drupal Hyderabad
●Siva Kumar Epari
✔2 years of Drupal experience
✔Drupal Developer
✔Webadmin & Core member of Drupal Hyderabad
4. Core Modules
These are the modules that ships with a Standard
Drupal Release. There are Core Optional and
Core Required modules.
For example:
Node
User
Block
System
Filter
5. Contrib Modules
Over 5800 (as of July 20, 2010) free community-
contributed modules, known as contrib modules,
are available to alter and extend Drupal's core
capabilities and add new features or customize
Drupal's behavior and appearance.
6. Popular Contrib Modules
These statistics are incomplete; only Drupal websites using
the Update Status module are included in the data.
7. Custom Module
A Custom module is one which is local to your
Drupal Project. It's not yet contributed to the
contrib repository.
8. Custom Module(When to write)
You need to answer few questions before writing a
Custom Module
1. What do you want to achieve by this custom module?
2. Did you search the Contrib Repository to see if a
module is already available for that feature?
3. Have you enabled all possible Configurations of the
Core & Contrib module to check if they offer you the
feature you require?
If your answer is, “Yes, I have done enough research and
am sure I have to write the code now”, then go ahead ....
9. Custom Module(Why to write)
I have 2 reasons to write a Custom module
1. I need a new feature which is not yet available in
Drupal, and probably can be contributed as a Contrib
Module.
2. I don't want to keep adding additional modules to my
site for small tweaks, which I can manage in only one
custom module for my website. Don't be too much
dependent on Contribs.
10. A simple module directory
structure
modulename.info
modulename
modulename.module
11. new.info
; $Id$
name = Module name
description = “Module description”
modulename.info core = Drupal version (e.g.: 5.x, 6.x)
package = Package name
; $Id$
name = Text Captcha
description = “Text Captcha”
new.info core = 6.x
package = Osidays
12. new.module
<?php
// $Id$
function new_form_alter(&$form, &$form_state, $formid){
if(substr($formid, -9) == 'node_form'){
$form['captcha'] = array(
'#type' => 'textfield',
'#title' => 'Captcha Question : What is 5 + 3?',
);
$form['#validate'][] = '_new_validate';
$form['#submit'][] = '_new_submit';
new.module }
}
function _new_validate($form, &$form_state){
if($form_state['values']['captcha'] != '8'){
form_set_error('captcha', 'Your Captcha answer is wrong!
So you are not a human or you don't know counting :D');
}
}
function _new_submit($form, &$form_state){
drupal_set_message('You are a human!');
}
26. hook_update()
Preventing SQL injection is easy; db_query provides a way to use
parametrized queries. Drupal's database functions replace the sprintf-like
placeholders with the properly escaped arguments in order of appearance:
%d - integers
%f - floats
%s - strings, enclose in single quotes
%b - binary data, do not enclose in single quotes
35. Menu Item Types
"type": A bitmask of flags describing properties of the menu
item. Many shortcut bitmasks are provided as constants in
menu.inc:
* MENU_NORMAL_ITEM: Normal menu items show up in
the menu tree and can be moved/hidden by the
administrator.
* MENU_CALLBACK: Callbacks simply register a path so
that the correct function is fired when the URL is accessed.
* MENU_SUGGESTED_ITEM: Modules may "suggest"
menu items that the administrator may enable.
* MENU_LOCAL_TASK: Local tasks are rendered as tabs
by default.
* MENU_DEFAULT_LOCAL_TASK: Every set of local tasks
should provide one "default" task, that links to the same
path as its parent when clicked.
If the "type" key is omitted, MENU_NORMAL_ITEM is
assumed.
47. Devel
● Devel: Helper functions for Drupal developers.
● Generate content: Accelerate development of
your site or module by quickly generating nodes,
comments, terms, users, and more.
● Node Access Summary: View the node access
entries for the node(s) that are shown on a page.