function system_theme_suggestions_maintenance_page

Same name in other branches
  1. 8.9.x core/modules/system/system.module \system_theme_suggestions_maintenance_page()
  2. 10 core/modules/system/system.module \system_theme_suggestions_maintenance_page()
  3. 11.x core/modules/system/system.module \system_theme_suggestions_maintenance_page()

Implements hook_theme_suggestions_HOOK().

File

core/modules/system/system.module, line 322

Code

function system_theme_suggestions_maintenance_page(array $variables) {
    $suggestions = [];
    // Dead databases will show error messages so supplying this template will
    // allow themers to override the page and the content completely.
    $offline = defined('MAINTENANCE_MODE');
    try {
        \Drupal::service('path.matcher')->isFrontPage();
    } catch (Exception $e) {
        // The database is not yet available.
        $offline = TRUE;
    }
    if ($offline) {
        $suggestions[] = 'maintenance_page__offline';
    }
    return $suggestions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.