Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Creating Your First Module

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 196
    Comment on it

    Creating module is easy in drupal

    Steps you need to follows are as below.

    1. Creating the module directory
    2. Creating the .info file
    3. Creating the .module file

    Where does your custom module goes?
    Its always better to keep contrib and custom modules seperate. So your module should goes under custom folder site->all->modules->custom->

    under this folder you should have at-least two files .info and .module file.

    .info and .module should have the same name as your module folder name.
    If you module folder name is myfistmodule then you should have and myfistmodule.module.

    Drupal uses .info files to store metadata about modules.

    For modules, the .info file is used for:

    rendering information on the Drupal Web GUI administration pages;
    providing criteria to control module activation and deactivation;
    notifying Drupal about the existence of a module;
    general administrative purposes in other contexts.

    name = My First Module 
    description = Provides   timezone handling
    core = 7.x

    The .info file can contain the following properties:

    name /*required*/
    description /*recommended*/
    core /*required*/
    version /*discouraged */
    project  /*discouraged, packaging use only*/
    project status url  /*only used for custom modules not submitted to*/

    More details about each property could be found on

    that's all you need in .info file

    myfirstmodule.module file contains your php code

    /*Here is my first module */

    And this is all you need to create you first module in drupal.

    By now your module should be available in module list . where you can enable/disable it.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: