Saturday, 30 May 2015

What are the mandatory fields to write .info file for module in DRUPAL 6?

.info file should have the same name as .module file and it should be in the same folder in which the later one exists.
name, description and core are the mandatory fields for .info files in modules.

Format :
name : 
name = "Test module"   ---   This is Drupal Capitalization Standard to have a capital letter as the first letter of the first word.  This is used as a display name for this module to admin.

descpirtion :
description = "This is description for Test module."   ---   This is useful to explain the purpose of your module in brief.  It has a limitation to have 255 characters.

core :
core = 6.x   ---   This is DRUPAL version but not the specific version like 6.3

Hence, here is the entire contents of .info file which has only mandatory fields:
name = "Test module"
description = "This is description for Test module."
core = 6.x

The following are some of the optional fields for .info file of module :
dependencies[]   ---   It is an array which contains the modules which needs to be enabled for the current module functionality.
package   ---   Used to group modules which might have internal dependencies.
php   ---   Used to mention the required php version for this module to work in proper.

No comments:

Post a Comment

Your comment is so valuable as it would help me in my growth of knowledge.