Using Modules

The Drupal codebase consists of a four entry point files in the root directory (cron.php, index.php, update.php, and xmlrpc.php), a core API mostly stored in the includes folder, themes in the themes folder, and modules in the modules directory. The chief mechanism for extending and modifying the functionality of Drupal lies in its modules.

A module is a file with the extension .module and can be either in the modules directory or in a subfolder of that directory. For example, the blog.module file be kept either at modules/ blog.module or at modules/blog/blog.module.

Drupal scans the modules directory to build a list of available modules. You can see this list by selecting administer> modules (admin/modules). A module must be enabled before its code is included and its functionality is available. The check boxes on the right indicate each module's status.

The default Drupal installation comes with a number of modules, not all of which are enabled. You'll find a complete description of all core modules and their configurations in Chapter 3. None of the core modules require any further steps such as downloading extra files, modifying the database, or applying patches to Drupal code before they can be used. Many of them require some sort of configuration, which can usually be done via a link in the administer > settings menu. If you have the Help module enabled, you can read a description of each activated module by clicking the administer > help link (admin/help).

You can add functionality to Drupal through the installation of contributed modules. In fact, all except the most basic Drupal sites will rely heavily on contributed modules. More than 180 contributed modules for the current release are listed at releases. The number of contributed modules is a testament to the extensibility of the Drupal platform and the ease with which new developers are able to learn the Drupal APIs and begin contributing.

The steps for installing a module can vary from simply copying the module into the modules directory and enabling it from the administer > modules pages to modifying the database, patching code, or running upgrade scripts. Chapter 4 covers installing and using contributed modules.

Was this article helpful?

0 0

Post a comment