Last updated September 15, 2020

Drupal media entities are fieldable entities, which means that you can add any custom fields you want to your Media types. These fields can be used for collecting additional metadata about a resource, categorizing and organizing resources so they're easier to find in a large media library, or for displaying information like a photo credit or transcript for a video. The possibilities are endless once you know how to add, and optionally display, fields in Drupal.

Some example use cases for adding fields to Media types:

  • Collect, and display, a credit to go along with a photo. This could also be a date, a location, or any other metadata.
  • Store resource width and height dimensions as custom fields so they can be referenced by display logic in the theme layer.
  • Use Taxonomy reference fields to add tags or categories to help keep a large library organized.

In this tutorial we'll:

  • Learn how to add fields to a Media type
  • Understand how custom fields on Media entities can use field mapping to collect additional resource data

By the end of this tutorial you'll know how to add custom fields to any Media type.