function claro_theme_suggestions_maintenance_page_alter

Same name in other branches
  1. 9 core/themes/claro/claro.theme \claro_theme_suggestions_maintenance_page_alter()
  2. 11.x core/themes/claro/claro.theme \claro_theme_suggestions_maintenance_page_alter()

Implements hook_theme_suggestions_maintenance_page_alter().

File

core/themes/claro/claro.theme, line 347

Code

function claro_theme_suggestions_maintenance_page_alter(&$suggestions) {
    try {
        $is_front = \Drupal::service('path.matcher')->isFrontPage();
    } catch (Exception $e) {
        // An exception could mean that the database is offline. This scenario
        // should also be rendered using the frontpage template.
        $is_front = TRUE;
    }
    if ($is_front) {
        // Add theme suggestion for maintenance page rendered as front page. This
        // allows separating different applications such as update.php from the
        // actual maintenance page.
        $suggestions[] = 'maintenance_page__front';
    }
}

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