>
Create customize module in drupal 6
Welcome, Guest

by Subhash on Saturday, 18 July 2009
Create customize module in drupal 6


A module in drupal 6 has following basic files

1: moduleName.module

2:moduleName.info

3:abc.tpl.php (optional for data rendering purpose

Content of .info file :

//.info starts

; $Id: moduleName.info,v 1.1 2009/01/27 19:59:24 sunsetbill Exp $
name = moduleName
description = Module discription.

; Information added by drupal.org packaging script on 2009-02-03
version = "6.x-1.x"
core = 6.x
datestamp = "1233669018"

//end

//.module content

<?php
// $Id: articleData.module,v 1.2 2009/01/27 22:22:52 sunsetbill Exp $
/**
* @file
* moduleName Module ;
*/
function moduleName_menu() { //hook_menu definition
 $items = array();

 $items['moduleName'] = array(
 'title' => 'Title',
 'page callback' => 'Function_name',
 'access arguments' => array('access content'),

 'type' => MENU_NORMAL_ITEM,
 );

return $items;

}  //hook_block for create a block for module

function moduleName_block($op='list', $delta=0) {
 if ($op == "list") {
 $block[0]['info'] = t('moduleName');
 return $block;
 }
 else if ($op == "view") {
 $path = drupal_get_path('module', 'moduleName');
 $block_content = '';
 $block['content'] = $block_content;
 return $block;
}
}

//calling function body

function function_name() {

$arr = (fetch data from database to be display)

$block_content = theme('abc',$arr); //calling theme function
 return $block_content;

}

function moduleName_theme() {
 return array(
 'abc' => array(
 'template' => 'abc', //abc is the name of tpl by which data will be show
 'arguments' => array('arr'=>nulll),
 ),

);
}



Blogger Image
My Blog Title

Product Engineering, software engineering company, Product Development, Product Migration, Product Re-engineering, Product Maintenance, Product Testing Commercial Application Development, Business Software development, commercial software for startups, Application Support and Maintenance, software testing Product Maintenance, Outsource product maintenance, product support and maintenance Product Migration, Product Re-engineering, product re-engineering services Product Research, Product Engineering, UI Prototyping Services Software Testing Services, Quality Assurance services, professional software testers, Load Testing, Functional Testing, Cross Platform, Browser Testing, Test Automation, Testing Tools, software quality analysis Functional Testing Services, software quality analysis, Software Testing Services, Application Testing Services, Functional Testing Types Automated Testing, Automated Testing Services, automation testing, test script development, Automation Test Tools, outsource automation testing Load Testing, Performance Testing Services, Load Testing Tools Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Benefits of IT Outsourcing, Offshore Software Development companies, offshore software development firms Outsource planning, IT outsourcing, IT development services, offshore IT companies, offshore software development Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering