Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

The Plugin module enhances Drupal's plugin system by making it easier to expose custom plugin types and work with plugins generically. It provides features like automatic plugin type discovery, enhanced support for plugin definitions, reusable plugin selectors for forms, and the ability to store plugins directly on content entities. It also serves as a testing ground for future improvements to Drupal core's plugin system.

The Plugin module complements Drupal core's plugin system in several ways. Its main aim is to make it easy to expose your custom plugin types to the world, and to let code work with any plugin of any plugin type generically. To facilitate that, and other features, it provides the following:

  • Plugin type discovery through modules' *.plugin_type.yml files. See the handbook for documentation on these files.
  • Extensive support for classed plugin definitions (objects), on top of core's \Drupal\Component\Plugin\Definition\PluginDefinitionInterface.
  • Plugin selectors allow users to select plugins of a particular type and configure them using the plugins' configuration forms. Using these reduces your form handling code from several hundreds of lines to ~5 lines of code. Some plugin forms do not correctly save their configuration. See #2536646: [meta] PluginFormInterface implementations assume they are top-level.
  • Filtered plugin manager decorators to easily filter/limit the plugins a manager can provide. These work with any existing plugin manager, and can be injected into other code easily.
  • A plugin field type that allows instances of any known plugin type to be stored on content entities. Plugin selectors are available as widgets. Basic generic formatters are available.
  • Overviews of known plugin types and plugins at Administer > Structure > Plugins.
  • Plugin configuration schemas. This allows saved plugin configuration to be translated, for instance. Their unified naming schemas allow for easy reusability. See the handbook for documentation on the format.

This project is also an incubator for improvements to Drupal core's plugin system that can be merged into Drupal core in future minor versions.

Integration

The following projects use Plugin and/or expose their plugin types through Plugin:

This module requires PHP 7 and Drupal 8.7.

Activity

Total releases
1
First release
May 2026
Latest release
2 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
8.x-2.14 Stable May 12, 2026