function layout_builder_test_preprocess_layout__twocol_section

Same name and namespace in other branches
  1. 10 core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module \layout_builder_test_preprocess_layout__twocol_section()
  2. 11.x core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module \layout_builder_test_preprocess_layout__twocol_section()

Implements hook_preprocess_HOOK() for two-column layout template.

File

core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module, line 150

Code

function layout_builder_test_preprocess_layout__twocol_section(&$vars) {
    if (!empty($vars['content']['#entity'])) {
        $vars['content']['first'][\Drupal::service('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.