From c5c96bf3611eeae4cef8d1e8a94bb64f72ee0877 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Mon, 15 Jan 2018 13:13:53 -0800
Subject: [PATCH] Issue #2935779 by tim.plunkett, EclipseGc, webchick, xjm,
 dead_arm: Come up with an affordance for what parts of the page are/are not
 affected by Layout Builder

---
 .../modules/layout_builder/layout_builder.module | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module
index 1ab27fab4141..895145d984e8 100644
--- a/core/modules/layout_builder/layout_builder.module
+++ b/core/modules/layout_builder/layout_builder.module
@@ -11,14 +11,28 @@
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\Context\Context;
 use Drupal\Core\Plugin\Context\ContextDefinition;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\Core\Url;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 
 /**
  * Implements hook_help().
  */
-function layout_builder_help($route_name) {
+function layout_builder_help($route_name, RouteMatchInterface $route_match) {
+  // Add help text to the Layout Builder UI.
+  if ($route_match->getRouteObject()->getOption('_layout_builder')) {
+    $output = '<p>' . t('This layout builder tool allows you to configure the layout of the main content area.') . '</p>';
+    if (\Drupal::currentUser()->hasPermission('administer blocks')) {
+      $output .= '<p>' . t('To manage other areas of the page, use the <a href="@block-ui">block administration page</a>.', ['@block-ui' => Url::fromRoute('block.admin_display')->toString()]) . '</p>';
+    }
+    else {
+      $output .= '<p>' . t('To manage other areas of the page, use the block administration page.') . '</p>';
+    }
+    return $output;
+  }
+
   switch ($route_name) {
     case 'help.page.layout_builder':
       $output = '<h3>' . t('About') . '</h3>';
-- 
GitLab