Introduction to Drupal 7

bammobInternet και Εφαρμογές Web

4 Δεκ 2013 (πριν από 3 χρόνια και 6 μήνες)

65 εμφανίσεις

Drupal Camp Deccan



Introduction to Drupal 7
Module Development


Presented By,


R. Anil Sagar,

Sr. Drupal Developer,

SourceN,

www.sourcen.com


Drupal Module Introduction

What is a module in Drupal ? !



Provides Features








A Folder With Set of Files


Core Modules



Contributed Modules



Custom Modules


Drupal Module Types


.info File



.module File



.install File




Module Structure & File Types


Meta Data about Module


name = My First D7 Custom Module


description = Gives an example of a module.


core = 7.x


package = Custom


dependencies[] = views


dependencies[] = panels


files[] = example.test


configure = admin/config/content/example

Module Info File


PHP Code



Set of Functions



Provides set of Features



.module File


A way to extend Drupal Core



Like Event


Trigger Mecanism



Hooks are nothing but functions with specific
syntax



hook_name (hook
--

module name, name
--

hookname)

Drupal Hooks


hook_block_info


http://api.drupal.org/api/drupal/modules
--
block
--
block.api.php/function/hook_block_info/7



hook_block_view


http://api.drupal.org/api/drupal/modules
--
block
--
block.api.php/function/hook_block_view/7

Let's create a block


hook_menu



http://api.drupal.org/api/drupal/modules
--
system
--
system.api.php/function/hook_menu/7



Associate array of menu meta data & Callback
function.

Let's create a page


hook_permission()



http://api.drupal.org/api/drupal/modules
--
system
--
system.api.php/function/hook_permission/7



Check using access_arguments in hook_menu

Restrict Access


hook_schema



hook_install



hook_uninstall

Database & Install File


Drupal Form API



http://api.drupal.org/api/drupal/developer
--
topics
--
forms_api_reference.html/7



drupal_get_form($form_id)



Validate, Submit Handler Functions

Let's create a Form


PHP Database Object (PDO) extension



db_query



Placeholders support



db_insert, db_update, db_delete functions

Database API


hook_theme



CSS & JS



drupal_add_js



drupal_add_css

Look & Feel

Thank you !

Presented By,

R. Anil Sagar,

Sr. Drupal Developer,

SourceN,

www.sourcen.com

Questions ?