Module Development

Concept: Field API and Fieldable Entities for Drupal 8, 9, 10, and 11

In Drupal, content entities can have fields. Field data is entered using widgets and displayed with formatters. The Field API provides developers with means to customize fields, widgets, and formatters. Which gives site builders tools to build flexible, extensible sites using customized data models.

In this tutorial, we'll:

  • Learn what it means for an entity to be fieldable.
  • Define what field types, widgets, and formatters are and give examples of each.
  • Explore the differences between base fields and user-defined fields.
  • Define the concept of field instances.

By the end of this tutorial you should be able to define the main components of the Field API and understand how developers leverage the Field API to alter and enhance Drupal.

Drupal Module Developer Guide