By roderik on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
3.x
Introduced in version:
3.0.0-beta1
Issue links:
Description:
In version 2, whenever Layout Builder was enabled in a (Drupal Core) entity view display, the custom element would be rendered using the defined layout.
In version 3, besides being enabled in the entity view display, "Use Layout Builder" must also be enabled in the corresponding Custom Elements Display.
Example
Rendering custom elements in "full" view mode, with the "full" entity view display having Layout Builder enabled:
Create a corresponding Custom Elements Display for the "full" view mode. All other view modes will continue being rendered using other methods.
EntityCeDisplay::create([
'targetEntityType' => $entity_type_id,
'bundle' => $bundle_key,
'mode' => 'full',
])->setUseLayoutBuilder(TRUE)
->save();
Note: creating a corresponding Custom Elements Display for the "default" view mode instead, will have almost the same effect:
- When no Custom Elements Display for the "full" view mode is enabled, the "default" one will be checked, which has useLayoutBuilder == True.
- This will result in a check on the Core entity view display for the appropriate view mode ("full" if it is enabled, otherwise "default"), for the "Layout Builder" setting. The custom element will only be rendered using Layout Builder, if this setting is enabled; otherwise, the appropriate rendering method is derived from the Custom Element Display's other settings.
Impacts:
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers