You are here

function hook_gin_lb_show_toolbar_alter in Gin Layout Builder 1.0.x

Alter if the gin lb toolbar is shown.

Parameters

boolean $gin_lb_show_toolbar: Alter this boolean flag.

1 invocation of hook_gin_lb_show_toolbar_alter()
gin_lb_theme_suggestions_form_alter in ./gin_lb.module
Implements hook_theme_suggestions_HOOK_alter().

File

./gin_lb.api.php, line 21
Hooks for the gin_lb module.

Code

function hook_gin_lb_show_toolbar_alter(&$gin_lb_show_toolbar) {

  // Sample check if layout builder is used inside page manager
  $route_match = \Drupal::routeMatch();
  $route_name = $route_match
    ->getRouteName();
  if ($route_name === 'entity.page.add_step_form' && $route_match
    ->getParameter('step') === 'layout_builder') {
    $gin_lb_show_toolbar = FALSE;
  }
}