Module Development

Field Formatters for Drupal 8, 9, and 10

Of the 3 main components of the field system -- types, widgets and formatters -- only 1 has an impact on the actual display of content for end users: field formatters. Field formatters are responsible for taking the data stored by a field and transforming it into the markup that is sent to the browser when an end user views your site.

In this tutorial we'll:

  • Look at the role field formatters play in the Field API
  • Identify the main components that make up a field formatter

By the end of this tutorial you should be able to define the role of a field formatter plugin.

Drupal Module Development