View source
<?php
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);
}
}
function splashify_theme($existing, $type, $theme, $path) {
return [
'splashify' => [
'variables' => [
'splashify_content' => NULL,
],
],
];
}