1:21PM – Beginning modules. Finally some meat. I have been interested in developing my own modules for a while, but never knew where to get started. Here we go:
- use api.drupal.org
- hooks – create a dir for the module
- create module_name.info file
- create module_name.module file (no closing php tag, start with it, but don’t end with it)
- if you’re creating something that makes new tables, you need a .install file. When you install and enable a module the first time, Drupal runs the hooks in the install file. The hook name is the name of the module file
- in the uninstall file, free any variables you create
- hook_nodeapi – operations on nodes that your module does NOT manage (on pre-existing node types) you can change weight to change execution order
- hook_form_alter – cool