How to create your first dupal Module

| Last Updated: | In: Drupal, PHP Tutorial


Now i explain the simple and easy steps to create a first drupal module. Our first module will show simple text, format it, and display it as a block in the site’s layout. There are two important files that every module must have.

The first is .info file, and the second file is .module (dot-module) file, which is a PHP script file.

Important Files

1) Creating the .info and .module files
2) Creating a new module
3) Using basic hooks
4) Installing and configuring the module

A Place for the Module files

Go to the root directory –> sites –> all –> modules.
Create a folder name helloworld

.info File

.Module File

Installing a Module

Step #1: Enabling The Module

Displaying the Module’s Content


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , , ,