function OliveroHooks::preprocessMaintenancePage
Same name and namespace in other branches
- main core/themes/olivero/src/Hook/OliveroHooks.php \Drupal\olivero\Hook\OliveroHooks::preprocessMaintenancePage()
Implements hook_preprocess_HOOK() for maintenance-page.
Attributes
#[Hook('preprocess_maintenance_page')]
File
-
core/
themes/ olivero/ src/ Hook/ OliveroHooks.php, line 52
Class
- OliveroHooks
- Hook implementations for olivero.
Namespace
Drupal\olivero\HookCode
public function preprocessMaintenancePage(&$variables) : void {
// By default, site_name is set to Drupal if no db connection is available
// or during site installation. Setting site_name to an empty string makes
// the site and update pages look cleaner.
// @see \Drupal\Core\Theme\ThemePreprocess::preprocessMaintenancePage()
if (!$variables['db_is_active']) {
$variables['site_name'] = '';
}
// Olivero has custom styling for the maintenance page.
$variables['#attached']['library'][] = 'olivero/maintenance-page';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.