Topic

Modules are bundles of primarily PHP code that extend Drupal in order to add new features or alter existing functionality. Modules can be installed to enable their features, and uninstalled to turn the features off. This flexibility allows Drupal users to tailor each instance of Drupal to their specific use-case, and to use only the features of Drupal that they need. There are thousands of community-contributed modules available. A large part of learning Drupal involves learning how to locate, install, and evaluate existing modules in order to determine if the functionality they provide is what you need.

Developers can write PHP, HTML, CSS and JavaScript to create new modules when necessary. A module can provide generic functionality (for example, integrating with Twitter) with the intent of contributing it back to the community. A project-specific module can either alter existing features or contain new custom features in order to solve specific project requirements.

There are three main types of modules:

  • core modules: modules that are included with Drupal core and live in the /core/modules directory
  • contributed modules: modules downloaded from Drupal.org that are not part of Drupal core, and are typically placed in the /modules/contrib directory
  • custom modules: project-specific modules that you or another developer wrote specifically for your application, and are typically placed in the /modules/custom directory

Example tasks

  • Locate a contributed module on Drupal.org and install it on your site
  • Write a custom module for a project that adds new features or alters existing ones

Confidence

The basic concept of modules, how they are integrated into a Drupal site, and the role they play is unlikely to change, so we have high confidence in modules.

Drupalize.Me resources

  • What is Drupal?
    • A high level overview of Drupal including what modules are and how they fit into the Drupal ecosystem.
  • Minor Version and Security Updates topic
    • Drupal has a regular release cycle to introduce new features and security updates. Contributed modules and contributed themes also have periodic updates to address security issues, add new features, and fix bugs.
  • Composer topic
    • In Drupal 8, we recommend using Composer whenever possible to manage Drupal core and contributed module code for your projects.
  • Drupal 8 Module Development Guide
    • Collection of tutorials that cover essential information for anyone wanting to learn how to develop modules.
  • Module Development Essentials
    • This series walks through writing a module from scratch and implementing some of the most common APIs and design patterns used by Drupal.
    • See also the following topic pages:

More Guides

We have guides on many Drupal skills and topics.

Explore guides

External resources