Loading core/lib/Drupal/Core/Layout/LayoutDefault.php +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public function build(array $regions) { $build[$region_name] = $regions[$region_name]; } } $build['#in_preview'] = $this->inPreview; $build['#settings'] = $this->getConfiguration(); $build['#layout'] = $this->pluginDefinition; $build['#theme'] = $this->pluginDefinition->getThemeHook(); Loading core/modules/block/block.module +1 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,7 @@ function template_preprocess_block(&$variables) { $variables['plugin_id'] = $variables['elements']['#plugin_id']; $variables['base_plugin_id'] = $variables['elements']['#base_plugin_id']; $variables['derivative_plugin_id'] = $variables['elements']['#derivative_plugin_id']; $variables['in_preview'] = $variables['elements']['#in_preview'] ?? FALSE; $variables['label'] = !empty($variables['configuration']['label_display']) ? $variables['configuration']['label'] : ''; $variables['content'] = $variables['elements']['content']; // A block's label is configuration: it is static. Allow dynamic labels to be Loading core/modules/block/templates/block.html.twig +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ * - label_display: The display settings for the label. * - provider: The module or other provider that provided this block plugin. * - Block plugin specific settings will also be stored here. * - in_preview: Whether the plugin is being rendered in preview mode. * - content: The content of this block. * - attributes: array of HTML attributes populated by modules, intended to * be added to the main container tag of this template. Loading core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ public function testBuildView() { '#markup' => 'Test1', ], ], '#in_preview' => FALSE, '#settings' => [ 'label' => '', ], Loading Loading @@ -243,6 +244,7 @@ public function testBuildForm() { '#process' => ['\Drupal\Core\Render\Element\RenderElement::processGroup'], '#pre_render' => ['\Drupal\Core\Render\Element\RenderElement::preRenderGroup'], ], '#in_preview' => FALSE, '#settings' => [ 'label' => '', ], Loading core/modules/layout_builder/layouts/fourcol_section/layout--fourcol-section.html.twig +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ * Default theme implementation for a four-column 25%-25%-25%-25% layout. * * Available variables: * - in_preview: Whether the plugin is being rendered in preview mode. * - content: The content for this layout. * - attributes: HTML attributes for the layout <div>. * Loading Loading
core/lib/Drupal/Core/Layout/LayoutDefault.php +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public function build(array $regions) { $build[$region_name] = $regions[$region_name]; } } $build['#in_preview'] = $this->inPreview; $build['#settings'] = $this->getConfiguration(); $build['#layout'] = $this->pluginDefinition; $build['#theme'] = $this->pluginDefinition->getThemeHook(); Loading
core/modules/block/block.module +1 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,7 @@ function template_preprocess_block(&$variables) { $variables['plugin_id'] = $variables['elements']['#plugin_id']; $variables['base_plugin_id'] = $variables['elements']['#base_plugin_id']; $variables['derivative_plugin_id'] = $variables['elements']['#derivative_plugin_id']; $variables['in_preview'] = $variables['elements']['#in_preview'] ?? FALSE; $variables['label'] = !empty($variables['configuration']['label_display']) ? $variables['configuration']['label'] : ''; $variables['content'] = $variables['elements']['content']; // A block's label is configuration: it is static. Allow dynamic labels to be Loading
core/modules/block/templates/block.html.twig +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ * - label_display: The display settings for the label. * - provider: The module or other provider that provided this block plugin. * - Block plugin specific settings will also be stored here. * - in_preview: Whether the plugin is being rendered in preview mode. * - content: The content of this block. * - attributes: array of HTML attributes populated by modules, intended to * be added to the main container tag of this template. Loading
core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ public function testBuildView() { '#markup' => 'Test1', ], ], '#in_preview' => FALSE, '#settings' => [ 'label' => '', ], Loading Loading @@ -243,6 +244,7 @@ public function testBuildForm() { '#process' => ['\Drupal\Core\Render\Element\RenderElement::processGroup'], '#pre_render' => ['\Drupal\Core\Render\Element\RenderElement::preRenderGroup'], ], '#in_preview' => FALSE, '#settings' => [ 'label' => '', ], Loading
core/modules/layout_builder/layouts/fourcol_section/layout--fourcol-section.html.twig +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ * Default theme implementation for a four-column 25%-25%-25%-25% layout. * * Available variables: * - in_preview: Whether the plugin is being rendered in preview mode. * - content: The content for this layout. * - attributes: HTML attributes for the layout <div>. * Loading