maintenance-page.tpl.php

  1. drupal
    1. 6 modules/system/maintenance-page.tpl.php
    2. 6 themes/garland/maintenance-page.tpl.php
    3. 7 themes/seven/maintenance-page.tpl.php
    4. 7 themes/bartik/templates/maintenance-page.tpl.php
    5. 7 modules/system/maintenance-page.tpl.php
    6. 7 themes/garland/maintenance-page.tpl.php
    7. 8 core/modules/system/maintenance-page.tpl.php
    8. 8 core/themes/seven/maintenance-page.tpl.php
    9. 8 core/themes/bartik/templates/maintenance-page.tpl.php

Override of the default maintenance page.

This is an override of the default maintenance page. Used for Garland and Minnelli, this file should not be moved or modified since the installation and update pages depend on this file.

This mirrors closely page.tpl.php for Garland in order to share the same styles.

5 theme calls to maintenance-page.tpl.php

File

themes/garland/maintenance-page.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Override of the default maintenance page.
  5. *
  6. * This is an override of the default maintenance page. Used for Garland and
  7. * Minnelli, this file should not be moved or modified since the installation
  8. * and update pages depend on this file.
  9. *
  10. * This mirrors closely page.tpl.php for Garland in order to share the same
  11. * styles.
  12. */
  13. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  14. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  15. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
  16. <head>
  17. <title><?php print $head_title ?></title>
  18. <?php print $head ?>
  19. <?php print $styles ?>
  20. <?php print $scripts ?>
  21. </head>
  22. <body class="<?php print $classes ?>">
  23. <!-- Layout -->
  24. <div id="header-region" class="clearfix"><?php print $header; ?></div>
  25. <div id="wrapper">
  26. <div id="container" class="clearfix">
  27. <div id="header">
  28. <div id="logo-floater">
  29. <?php
  30. // Prepare header
  31. $site_fields = array();
  32. if ($site_name) {
  33. $site_fields[] = $site_name;
  34. }
  35. if ($site_slogan) {
  36. $site_fields[] = $site_slogan;
  37. }
  38. $site_title = implode(' ', $site_fields);
  39. if ($site_fields) {
  40. $site_fields[0] = '<span>' . $site_fields[0] . '</span>';
  41. }
  42. $site_html = implode(' ', $site_fields);
  43. if ($logo || $site_title) {
  44. print '<h1 id="branding"><a href="' . $base_path . '" title="' . $site_title . '">';
  45. if ($logo) {
  46. print '<img src="' . $logo . '" alt="' . $site_title . '" id="logo" />';
  47. }
  48. print $site_html . '</a></h1>';
  49. }
  50. ?>
  51. </div>
  52. </div> <!-- /header -->
  53. <?php if ($sidebar_first): ?>
  54. <div id="sidebar-first" class="sidebar">
  55. <?php print $sidebar_first ?>
  56. </div>
  57. <?php endif; ?>
  58. <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
  59. <?php if ($title): ?><h2><?php print $title ?></h2><?php endif; ?>
  60. <?php print $messages; ?>
  61. <?php print $help; ?>
  62. <div class="clearfix">
  63. <?php print $content ?>
  64. </div>
  65. <div id="footer"><?php print $footer ?></div>
  66. </div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->
  67. <?php if ($sidebar_second): ?>
  68. <div id="sidebar-second" class="sidebar">
  69. <?php print $sidebar_second ?>
  70. </div>
  71. <?php endif; ?>
  72. </div> <!-- /container -->
  73. </div>
  74. <!-- /layout -->
  75. </body>
  76. </html>

Comments

Custom maintenance text

When creating a custom maintenance-page.tpl.php page you lose the default Maintenance text:

Site under maintenance
SITE NAME is currently under maintenance. We should be back shortly. Thank you for your patience.

what controls this and how do you get it back??

print $content

You can use the following to display the maintenance mode message:

<?php print $content; ?>

Maintenance page doesnt html.tpl.php

Because maintenance-page.tpl.php does not run through html.tpl.php, you cannot simply copy the content's of page.tpl.php.

I encountered this when implementing a custom maintenance page in a subtheme that inherited html.tpl.php from a base theme.

You must add in the <head> section as well as the <body> and <html> wrapper tags (depending on what your html.tpl.php provides), and thus, the maintenance page will usually end up being some sort of homegrown, trimmed down version of html.tpl.php + page.tpl.php.

Login or register to post comments