Arrange compound sub-fields in Layout Builder¶
Prepare a featured session¶
Enable Layout Builder and its Compound Field integration:
drush en compound_field_layout_builder -y
Create and attach a single-value Featured session compound field on Conference with these single-value sub-fields:
| Sub-field | Type | Shared formatter |
|---|---|---|
| Session title | Short text | Plain text |
| Contact email | Email link | |
| Related conference | Content reference limited to Conference | Label, linked to entity |
Keep all three visible on the compound's Manage display. Save a Conference named
Accessibility summit, then another with session title Opening keynote,
email conference@example.com and a reference to Accessibility summit.
Enable the Conference layout¶
You need permission to administer displays and layouts. This changes the default layout for all conferences.
- Open Structure → Content types → Conference → Manage display.
- Under Layout options, select Use Layout Builder and save.
- Open Manage layout. Clear Show content preview to see block names.
Place the sub-fields separately¶
- Remove the example's default section. Stored content remains intact.
- Select Add section → Two column.
- In the left column, select Add block, filter by
Featured session, and add Content fields → Featured session: Session title. - Add Featured session: Contact email and Featured session: Related conference to the right column.
- Select Save layout.
View and check the result¶
Open the Conference and check the title and links. Reopen Manage layout to check the saved positions.
Blocks use the compound's shared formatters. Host-field overrides do not apply; a sub-field hidden on the shared display renders nothing. With repeated compound items, each block collects that sub-field across items. Place the whole compound field to keep each session together.