Render layout builder section as SDC component

Created on 6 March 2024, 3 months ago
Updated 4 April 2024, 2 months ago

Problem/Motivation

In layout builder, we can add sections and blocks.

In manage display, we can wrap fields in field groups rendered as components, but can't add additional blocks to the entity display.

Creating a custom layout is a relatively similar process as a component, and you could load a component inside a layout if you want.

However, adding a layout for a single display adds it to the list in layout builder, and in cases where you want to render a component you already have seems redundant.

Let's create a layout that renders a selected component, getting props and slots from the entity fields and section blocks.

This would unlock a ton of power. You can add a section to any layout that renders any component, and you can add inline blocks rendered as components using tokens to populate the variables.

As a bonus, this will get around an with contextual links, which are not rendered when a component is rendered as SDC since those come from the entity template. Layout builder uses the entity template, but takes over the content variable printed inside it, so the contextual links are preserved. This doesn't matter for full page displays, but often for teasers or related content displays it can be helpful to have access to the edit links.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024