On this page
Telling Drupal about your module
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
Main topic described: .info files
All modules must have a “modulename.info” file, which contains meta information about the module.
The general format is:
name = Module Name
description = A description of what your module does.
core = 7.x For our module, we will replace “Module Name” in the example above with the name of our module, “Current Posts”. Without this file, the module will not show up in the module listing. Here is our specific example:
name = Current Posts
description = A block module that lists links to recent posts.
core = 7.x
package = My Modules Add the source above to a file named current_posts.info and save it into the module’s directory at sites/all/modules/current_posts.
Note: If you copy and paste this code block, ensure that the description data does not contain a line break (turn off word-wrap on your text-editor to be sure). Otherwise, the .info file will not parse correctly.
.Info File Details
The details of what to put in a .info file can be found on the Writing .info files page.
Check
Your module should now appear in the module list in your site. Go to Modules and scroll down to the bottom of the list in the “My Modules” category. You should see the module “Current Posts” or otherwise the name of the module you chose.
(Make sure you created a “modulename.module” file as described in the tutorial’s previous step.)
See also
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion