Extending and altering Drupal

Overview of add-ons and alteration methods for Drupal.

Drupal's core behavior can be extended and altered via these three basic types of add-ons:

  • Themes: Themes alter the appearance of Drupal sites. They can include template files, which alter the HTML markup and other raw output of the site; CSS files, which alter the styling applied to the HTML; and JavaScript, Flash, images, and other files. For more information, see the Theme system and render API topic and https://drupal.org/theme-guide/8
  • Modules: Modules add to or alter the behavior and functionality of Drupal, by using one or more of the methods listed below. For more information about creating modules, see https://drupal.org/developing/modules/8
  • Installation profiles: Installation profiles can be used to create distributions, which are complete specific-purpose packages of Drupal including additional modules, themes, and data. For more information, see https://drupal.org/documentation/build/distributions.

Here is a list of the ways that modules can alter or extend Drupal's core behavior, or the behavior of other modules:

  • Hooks: Specially-named functions that a module defines, which are discovered and called at specific times, usually to alter behavior or data. See the Hooks topic for more information.
  • Plugins: Classes that a module defines, which are discovered and instantiated at specific times to add functionality. See the Plugin API topic for more information.
  • Entities: Special plugins that define entity types for storing new types of content or configuration in Drupal. See the Entity API topic for more information.
  • Services: Classes that perform basic operations within Drupal, such as accessing the database and sending email. See the Dependency Injection Container and Services topic for more information.
  • Routing: Providing or altering "routes", which are URLs that Drupal responds to, or altering routing behavior with event listener classes. See the Routing and menu topic for more information.

File

drupal/core/modules/system/core.api.php, line 1252
Documentation landing page and topics, plus core library hooks.