You are here

function splashify_preprocess_html in Splashify 8.2

Implements hook_preprocess_HOOK().

File

./splashify.module, line 6

Code

function splashify_preprocess_html(&$variables) {
  $route = \Drupal::routeMatch()
    ->getRouteObject();
  $is_admin = \Drupal::service('router.admin_context')
    ->isAdminRoute($route);
  if ($is_admin) {
    return;
  }
  $splash = \Drupal::service('splashify.injection')
    ->getAttach();
  if (!empty($splash)) {
    array_unshift($variables['page_top'], $splash);
  }
}