Developer Best PracticesDeveloper Best Practices

GeneralGeneral

DO NOT alter any file that is a part of Drupal Core. Any file that is a part of Drupal Core is subject to being overwritten without notice. There are many ways around doing this, please jim [at] geekgene [dot] com if you need assistance.

Drupal ModulesDrupal Modules

Any module added to Drupal, be it a module downloaded from the Drupal web site, or developed internally, should go in its own folder within the /contributed/ folder. Drupal will automatically descend the tree and find the modules.

example: /modules/contributed/mymodule/mymodule.module

Do not place any module directly in the /modules folder. Any add-on module that does not reside in the /contributed/ folder is likely to be deleted when performing site upgrades.

Modules should be self-installing. Modules should include a .mysql file for creating any database tables at install-time, and should also include an .install file to perform the module setup work. Refer to the Writing .install files article on the Drupal web site.

Drupal ThemesDrupal Themes

Same as modules. Use a /contributed directory in the /themes directory for any downloaded or custom-developed themes. Hard-coding paths (to images, scripts, etc.) in a PHPTemplate file or sytle sheet is strongly discouraged.