Currently it is not possible to toggle the preview content, nor does extra functionality provided by additional modules or patches work since the action buttons do not appear. This patch also doesn't work in combation with this module: #3080606: [PP-1] Reorder Layout Builder sections

It would be great if it were somehow possible, and would remove the need to use the layout page at all.

Comments

NWOM created an issue.

johnpitcairn’s picture

Playing around with this a bit ... if you are using the Gin admin theme, and Gin Layout Builder module, you can get it working. The module provides an alter hook that will let you specify which routes it should apply to, so:

function MYMODULE_gin_lb_is_layout_builder_route_alter(bool &$is_lb_route, array $context) {
  if (\Drupal::routeMatch()->getRouteName() === 'entity.node.edit_form') {
    $is_lb_route = TRUE;
  }
}

Will get you the Gin layout builder sidebar, with the content/region preview display option widgets in the Gin secondary toolbar. Promising.

Less ideal ... if you then go to /node/X/layout, the Gin sidebar will have the layout builder moved into it.