ต้องสร้างไฟล์ module_name.info สำหรับบอก Drupal ตัวอย่างนี้คือ
$ vi onthisdate.info
; $Id$ name = On this date description = A block module that lists links to content such as blog entries or forum discussions that were created one week ago. core = 6.x
ต้องมีหัวข้อดังนี้
description = This is my "crazy@email.com" email address instead of description = This is my "crazy@email.com" email address
อาจมีหัวข้อดังนี้
dependencies[] = taxonomy
dependencies[] = commentpackage = "ชื่อมอดูลที่ร่วม"
ลองฟังก์ชั่นแรกคือ help
$ vi onthisdate.module
<?php
/**
* Display help and module information
* @param path which path of the site we're displaying help
* @param arg array that holds the current path as would be returned from arg() function
* @return help text for the path
*/
function onthisdate_help($path, $arg) {
$output = '';
switch ($path) {
case "admin/help#onthisdate":
$output = '<p>'. t("Displays links to nodes created on this date") .'</p>';
break;
}
return $output;
} // function onthisdate_help
?>
ตัวแปร $path แทนพาธว่า help ของเราจะไปอยู่ตรงไหน
ดูเพิ่มที่