Skip to content

Theme View Display

Theme View Display lets a site builder override an entity view display for a single theme. The override replaces the display only while that theme is active. Every other theme keeps rendering the display it rendered before.

The Manage display overview with a Theme overrides column listing the themes that override each view mode

What it does

  • One override per theme, entity type, bundle and view mode. The override is a config entity named theme_view_display.display.{theme}.{entity_type}.{bundle}.{mode}.
  • Falls back to the core display. A theme without an override, or with an inactive one, renders the core display as before.
  • Managed in Field UI. The Manage display overview gets a column and an action. Each override has an edit page that works like the core one. Field UI is optional: without it, overrides render the same and are managed with recipes and config actions.
  • Three ways to build an override. The formatter table, field groups with the theme_view_display_field_group sub-module, and Display Builder with theme_view_display_builder.
  • Dependencies follow the theme. An override depends on its theme, on the core display it overrides, and on the themes and modules providing the components it uses.
  • Recipes. The standard display config actions work on overrides, and one extra action creates an override from a view display.

How a display is chosen

flowchart TB
    Entity[Entity is rendered<br/>in view mode M] --> Core[Core finds the display:<br/>M, else default]
    Core --> Lookup{Active theme has an<br/>active override for<br/>that display?}
    Lookup -- yes --> Override[Render the override's<br/>components]
    Lookup -- no --> Fallback[Render the core display]

The lookup uses the mode of the display core found, not the mode requested. If full is disabled and core falls back to default, the default override of the active theme applies.

Requirements

  • Drupal 11.4 or later

Optional:

Module Adds
Field UI (core) The screens to create, edit and revert overrides, the overview column and the action. Without it, nothing changes in how overrides render.
Display Builder 1.0.0-beta10 or later Build an override with Display Builder, in the theme_view_display_builder sub-module
Field Group 4.x Field groups of their own in an override, in the theme_view_display_field_group sub-module
Extra Field 3.x Nothing to install. Extra fields work in overrides, see Fields and extra fields

Start with Installation.