function LayoutBuilderTestThemeHooks::layoutTwocolSection
Implements hook_preprocess_HOOK() for two-column layout template.
Attributes
#[Hook('preprocess_layout__twocol_section')]
File
-
core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ src/ Hook/ LayoutBuilderTestThemeHooks.php, line 47
Class
- LayoutBuilderTestThemeHooks
- Theme hook implementations for layout_builder_test.
Namespace
Drupal\layout_builder_test\HookCode
public function layoutTwocolSection(&$vars) : void {
if (!empty($vars['content']['#entity'])) {
$vars['content']['first'][$this->uuid
->generate()] = [
'#type' => 'markup',
'#markup' => sprintf('Yes, I can access the entity %s in two column', $vars['content']['#entity']->label()),
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.