Site Building

6.10. Concept: View Modes and Formatters for Drupal 8, 9, and 10

What is a View mode?

How an entity (such as content, a user or a comment) is displayed, depends on the context in which it is shown. This context is known as a view mode. Examples of view modes are:

  • a full page of the content with all the field values
  • a teaser of the content with a thumbnail image and a Read more link
  • a full user profile with a zoomable portrait photo
  • a user avatar with username and a link to the profile

Every view mode can be configured through the administration pages. To see the configuration options for the view modes of the Recipe content type, navigate in the Manage administrative menu to Structure > Content types (admin/structure/types) and click Manage display from the dropdown button. In each view mode, all fields can be hidden or displayed, and if they are displayed, you can choose and configure the field formatter.

What is a field formatter?

A field formatter is a setting for displaying the field values. For example, long text fields can be displayed trimmed or full-length, and taxonomy term reference fields can be displayed in plain text or linked to the taxonomy term page. Consult the Manage display page to see the field formatters for the fields of the Recipe content type.

Additional resources

Drupal.org community documentation page "View modes"

Attributions

Adapted by Boris Doesborg from "View modes", copyright 2000-2024 by the individual contributors to the Drupal Community Documentation.