Creating the actual ".module" file

... Which brings us to the .module file.  The first part is a partial repeat of what we just did, but it's equally necessary.

  • Open Notepad (or if it's already open, create a new file)
    • File » New
  • Before you do any writing this time, immediately click File » Save
    • (This is for convenience purposes only, but it's well worth it.)
  • Again, make sure you're saving it in the mymodule folder you already created
  • Where it says Save as type: Text Documents (*.txt) change Text Documents (*.txt) to All Files (*.*)
  • Where it says Encoding: ANSI change ANSI to Unicode
  • Next to Filename: type mymodule.module (instead of what you typed last time, which was mymodule.info)
  • Click Save

You should now have a file named mymodule.module, along with your mymodule.info file, both inside the same folder (whose name is mymodule). Here's a little "tree" diagram:

» My Desktop

⌊» mymodule

⌊» mymodule.info

⌊» mymodule.module

NOW, with the mymodule.module file still open, we can start writing the module itself.

 

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Allowed HTML tags: <a> <em> <strong> <cite> <ul> <ol> <li> <dl> <dt> <dd> <b> <i> <br> <hr> <blockquote> <q>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options