layout_builder_formatter
Security covered
Overview
Layout Builder Formatter solves a common frustration when using Drupal's Layout Builder: the loss of control over the "Manage Display" interface.
Normally, when you enable Layout Builder for a display (e.g., a Content Type), Drupal hides the standard "Manage Display" field table and assumes the entire page rendering will be handled by the layout. This makes it difficult to:
- Position the Layout content relative to other fields (e.g., forcing a distinct "Header" field to always be above the layout).
- Use standard field formatters alongside Layout Builder.
- Prevent fields from randomly moving to "Disabled" or "Hidden" when Layout Builder is active.
Layout Builder Formatter restores this control by exposing the Layout Builder content as a standard, sortable field (layout_builder__layout) with a dedicated formatter.
Key Features
- Hybrid Mode: Use Layout Builder for the main content area while still managing other fields via the standard Field UI.
- Drag-and-Drop Control: The "Layout" field appears in the "Manage Display" table. You can drag it, weight it, and place it in any region just like a Body or Image field.
- Standard Saving: Fixes known issues where enabling Layout Builder prevents other field settings (like Formatters or Weights) from being saved.
Comparison with Layout Builder Widget
This module works hand-in-hand with the Layout Builder Widget module:
- Layout Builder Widget: Handles the Editing experience. It provides a Form Widget that lets authors edit the layout directly on the Node Edit form (backend), properly integrating with the admin theme.
- Layout Builder Formatter: Handles the Display experience. It provides the Formatter that ensures the layout renders correctly on the frontend and can be positioned alongside other fields.
Use them together for a complete "Layout as a Field" experience.
Installation & Usage
- Install and enable the module.
- Go to Manage Display for your entity (e.g.,
admin/structure/types/manage/article/display). - Check Use Layout Builder and Allow each entity to have its layout customized.
- You will see the Layout field (
layout_builder__layout) appear in the field table. - Drag it to your desired position.
- Ensure the Format is set to Layout Builder.
- Save.