Skip to content

Installation

Drupal 11.4+

Display Builder targets Drupal 11.4+. No previous version of Drupal support is planned.

It also requires PHP 8.3+ and UI Patterns 2.0.23, exactly.

Try it with the Bootstrap recipe

The quickest way to see Display Builder at work is a new site built from the Display Builder with Bootstrap recipe. It installs Display Builder with the UI Suite Bootstrap theme, demo content, page layouts already built, the homepage included, and pattern presets of Bootstrap sections.

It only applies to a new site installed with the Minimal profile. Follow the steps of its project page, then come back to Build your first display.

On a site built with Drupal CMS, see Install on Drupal CMS instead.

Install the module

Like any other Drupal module, it is recommended to use composer:

composer require drupal/display_builder

UI Patterns patches

Display Builder pins UI Patterns to 2.0.23 and ships two patches for it in its composer.json, until these issues land in a UI Patterns release:

  • #3630451: source labels and prop source lists redo the full lookup on each call
  • #3630456: SourceValueItem::setValue() walks the whole source tree on each load

Both make the builder faster. Display Builder works without them. Updating UI Patterns past 2.0.23 waits for a Display Builder release.

Composer applies them with composer-patches:

  • 2.x applies the patches of dependencies by default, but reads them from patches.lock.json once it exists. After requiring or updating Display Builder, run composer patches-relock then composer patches-repatch.
  • 1.x applies them only when the root composer.json has its own patches section, or sets "enable-patching": true under extra.

Display Builder is split in sub-modules, one for each Drupal Core's display buildable:

They can be activated from Administration > Extend (/admin/modules) or with Drush:

drush -y en display_builder_entity_view display_builder_page_layout display_builder_views

You can also install Display Builder UI to configure Display Builder:

drush -y en display_builder_ui

With the module installed, follow Build your first display to build a display end to end.

Display Builder is automatically activating its dependencies:

The sub-modules activate their own dependencies too:

  • Entity view (display_builder_entity_view): Field UI, and UI Patterns Field Formatters to format each field item in entity displays
  • Views (display_builder_views): Views, and UI Patterns Views

We are also recommending:

Without Navigation, content keeps its override tabs, but no link leads from a page to its page layout, entity view display or Views display: open them from the administration pages. The Toolbar module has no equivalent dropdown.

Local libraries

Display Builder relies on Shoelace component library, and HTMX sse extension.

By default libraries are loaded with CDN, but you can switch to local copies with drush:

drush state:set display_builder.asset_libraries_local true
drush cache:rebuild

And switch back to CDN mode with drush:

drush state:delete display_builder.asset_libraries_local
drush cache:rebuild

Currently asset.packagist provides a version of Shoelace with Lit dependencies.

Installation with package manager is recommended.

From your installation libraries folder (web/libraries or app/libraries):

mkdir -p shoelace
cd shoelace
npm init -y
npm install @shoelace-style/shoelace

Then, back in the libraries folder:

cd ..
mkdir -p htmx-ext-sse
cd htmx-ext-sse
npm init -y
npm install htmx-ext-sse