This project will cover the creation of a Drupal sample module.
Steps:
- Decide what to call your module. This name will be used thoughout the project. it should be in all lowercase and should not be the same as a theme name.
- As an example I will use "mymodule" as the name of the new module. Replace this example name with the name of your module. everywhere it is referenced in the steps.
- Create a new folder in your /sites/all/modules folder or your site specific modules folder (e.g., yoursite.com/modules using the name of your new module (forlder name will be "mymodule".
- Create another file called "mymodule.info" and open it with an editor. Remove any contents that were placed there by your editor or IDE...just in case. Then enter the following:
name = mymodule
description = My module's custom description.
core = 6.x - You can change the core version to whichever you are using.
- Save that file to the "mymodule" folder. Drupal will not "see" your module without this (mymodle.info) file.
- Create a new PHP file with the name "mymodule.module". This is the main file Drupal will use to integrate your module and will contain the main interface points.
Topic Tags:
