June 01, 2009
What You Should Know About Drupal File Management
You should know...
How to manage javascript
- tip: jQuery plugins can be downloaded to sites/all/js for easier management
- tip: Custom plugins should be either attached to a custom module or custom theme. The choice is based on whether the plugin helps a module, or purely acts at the design layer.
- eg: A plugin that adds DHTML UI elements for a block should live in the module that creates the block.
- eg: A plugin that adds DHTML navigation for the site would reside in the theme
You should know...
How to manage javascript
- tip: jQuery plugins can be downloaded to sites/all/js for easier management
- tip: Custom plugins should be either attached to a custom module or custom theme. The choice is based on whether the plugin helps a module, or purely acts at the design layer.
- eg: A plugin that adds DHTML UI elements for a block should live in the module that creates the block.
- eg: A plugin that adds DHTML navigation for the site would reside in the theme
How to manage modules
- tip: Use logical separations for development, contrib, and custom modules. For example:
sites/all/modules/contrib # Modules checked out from Drupal.org CVS
sites/all/modules/custom # Custom created modules
sites/all/modules/development # Development ONLY modules
How to manage CSS
- see: HTML and CSS techniques and tools from Drupal.org
- tip: Ensure module specific CSS is inside the custom module
- tip: Ensure theme specific CSS is inside the custom theme
- see: Structure of the .info file, use the custom theme .info file to add CSS
How to manage images
- tip: Images are nearly ALWAYS part of a custom theme. Hence they should live inside the custom theme (eg: sites/all/themes/my_theme/images). Images should NEVER be put inside the/images directory in the root of the site, this folder is part of Drupal core.
