Some fields in Drupal seem to appear as if by magic. You create a content type, and there’s the Title field—already there, even though you didn’t add it through the user interface. Where did it come from, and why does it behave a little differently from the fields you create in the UI? Meet base fields. 

Base fields are defined in code using APIs provided by Drupal core, and they form the backbone of Drupal’s content entities. In this session, we’ll pull back the curtain on base fields and explore what makes them special. We’ll start by covering:

  • What base fields are and how they’re defined in code
  • How base field data is stored, and how it differs from UI-created fields
  • Common base fields used by Drupal core’s content entities
  • Contributed modules that add new base fields or alter existing ones

Then we’ll look at:

  • How to create your own base fields
  • How base fields can provide more efficient database storage and simpler queries
  • Why you might want the same field on every content type
  • The tradeoffs: flexibility vs. structure, power vs. complexity

This session will provide useful information for Drupal developers who want a deeper understanding of Drupal’s entity system, site builders who’ve wondered why some fields “just exist,” and architects looking to standardize content models.

Audience: All Track(s): Content Strategy, Site Building