Media entities are standard Drupal fieldable content entities. For the most part, they function, and are managed, in the same way as Nodes. So if you’ve previously created content in Drupal, much of working with Media entities should be familiar — with some notable exceptions related to the connections between Media types and the media resources they represent.
In this tutorial we’ll:
- Get an overview of Media entities, Media types, and Media fields in Drupal
- Point to other tutorials that go into more depth on individual topics
- Learn some basic terminology and concepts related to the Media system in Drupal
By the end of this tutorial you’ll have an overview of the pieces that make up the Media system in Drupal core.
Goal
Explain how Media Types and Media Fields fit into the broader Entity/Fields-based information architecture of Drupal.
Prerequisites
Media entities are standard Drupal fieldable content entities with a couple of notable additions that we’ll explain. Media entities can be referenced anywhere that Drupal knows how to work with content entities. They can take advantage of the full suite of tools that Drupal provides for managing content entities like Views, Workflows, Content Moderation, JSON:API, access control, and more.
To take full advantage of the Media system it helps to have a solid understanding of the following concepts:
For everyone
If you’re not familiar with content entities and fields as Drupal concepts, start with 2.3. Concept: Content Entities and Fields.
Chapter 6. Setting Up Content Structure covers the basics of administering and configuring content entities. While it focuses on Nodes, the same concepts apply to Media entities.
For developers
To better understand how the Media system works from a code perspective you’ll want to be familiar with the following:
Media entities
An entity is an item of content data, which can consist of text, HTML markup, images, and any other data. At least a subset of this data is intended to be consumed by site visitors. “Media entities” specifically refers to data which represents media resources. Examples include images, documents, audio files, remote videos, and even things like an Instagram or Twitter URL which doesn’t necessarily fit into the traditional definition of media.
For example, think of an image file (a resource), plus some associated tags for organizing purposes, and a photo credit naming the photographer and date. Include metadata like width/height of the image, who created the record in Drupal, and whether the record is published or not.
Next, consider an Instagram URL (a resource) that represents an image, comments, likes, and metadata, as well as resource-specific logic for creating an HTML representation of the thing to display.
Every individual media resource, whether it’s an image, a remote video on YouTube, or a PDF file, is a Media entity.
Providing an abstraction like this around different types of media resources allows code in Drupal to be able to do things like find, load, and display a resource without having to know the specific details of that resource. That makes the system flexible while still being predictable.
Learn to administer Media entities.
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
Read Bluff
.