This project is not covered by Drupal’s security advisory policy.

Theme View Display overrides an entity view display for a single theme. The theme renders its own fields, formatters, field groups or Display Builder layout, and every other theme keeps using the display you already have.

How it works

An override is a config entity for one theme, entity type, bundle and view mode. While that theme is active, it replaces the core display. With no override, or an inactive one, the core display renders as before. Overrides depend on their theme the way blocks do, so uninstalling the theme deletes them.

Features

  • Override any entity view display for one theme, from the Manage display pages of Field UI. The overview gets a "Theme overrides" column and an "Add theme override" action next to "Add field group".
  • Start an override as a copy of the core display, or of another theme's override. The copy is independent from then on.
  • Switch between the core display and each override on one page. The core display warns you which themes override it, so changes there do not surprise anyone.
  • Enable, disable or revert an override without touching the core display.
  • New fields are hidden in every override of the bundle and the change is saved, so an override never shows a field nobody placed in it.
  • Extra fields, such as those from Extra Field, can be placed or hidden per override.
  • Config dependencies follow the override: its theme, the core display, and the themes and modules providing the SDC components it uses. Removing a component provider prunes the sources that use it.
  • Config actions for recipes. The display actions of core work on overrides, and createThemeOverride creates an override from a view display for a given theme.
  • A status report line with the number of overrides per theme, and a Drush command, theme-view-display:list.

Formatter table

The Manage display form of Field UI, working on the override.

Field Group

The theme_view_display_field_group sub-module gives an override field groups of its own.

Display Builder

The theme_view_display_builder sub-module builds an override with Display Builder, previewed in the override's theme.

Displays that use Layout Builder are not overridden. The override is skipped and a warning is logged. See the documentation for the other limitations.


Installation

Install with Composer and enable the module:

composer require drupal/theme_view_display

drush en theme_view_display

Enable the sub-modules you need:

drush en theme_view_display_builder

drush en theme_view_display_field_group

Grant "Administer theme view displays" to the roles that manage displays. The same roles need the "Administer [entity type] display" permission of the entity type. Then open the Manage display page of a bundle and click "Add theme override".

Documentation

Usage, recipes, limitations and developer notes are published on GitLab Pages.

Read the documentation


Requirements/Dependencies

  • Drupal 11.4 or later

Optional:

  • Field UI (core), for the screens to create and edit overrides. Without it, overrides still render and are managed with recipes, config actions or config import.
  • Display Builder 1.0.0-beta10 or later, for the theme_view_display_builder sub-module.
  • Field Group 4.x, for the theme_view_display_field_group sub-module.
  • Extra Field 3.x. Nothing to enable for it; its extra fields work in overrides.
AI Disclosure.

Note that extensive parts of this module were generated via AI coding agents under supervision.

Supporting organizations: 
Sponsor development

Project information

Releases