Chapter 7. Plug and Play with Plugins

In this chapter, we will dive into the new Plugin API provided in Drupal 8:

  • Creating blocks using plugins
  • Creating a custom field type
  • Creating a custom field widget
  • Creating a custom field formatter
  • Creating a custom plugin type

Introduction

Drupal 8 introduces plugins. Plugins power many items in Drupal, such as blocks, field types, field formatters, and many more. Plugins and plugin types are provided by modules. They provide a swappable and specific functionality. Breakpoints, as discussed in Chapter 5, Front End for the Win, are plugins. In this chapter, we will discuss how plugins work in Drupal 8 and show you how to create blocks, fields, and custom plugin types.

Each version of Drupal has had subsystems, which ...

Get Drupal 8: Enterprise Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.