3

As the title explains, I want to make a custom maintenance page, different from the default one.

For that I've read this tutorial: Theming the Drupal maintenance page.

I copied the file /module/system/maintenance-page.tpl.php to my theme folder, changed it a little bit, and I enabled the $conf['maintenance_theme'] = 'themeName'; line in settings.php; but I can't see the changes

What else do I need to do?

5
  • 1
    Did you clear your cache?
    – 4life
    Commented Jun 20, 2013 at 16:05
  • no i didn't but i'm not using any cache system Commented Jun 20, 2013 at 16:59
  • Drupal has built-in caches. They must be cleared after any change.
    – beth
    Commented Jun 20, 2013 at 17:13
  • Are you using Drupal 6 or 7?
    – Bala
    Commented Jun 20, 2013 at 17:15
  • i'm using D7, and even when i cleared the cache nothing happened Commented Jun 20, 2013 at 17:25

3 Answers 3

3

Hope this will help you,

Before site goes offline for maintenance mode, check the user who has permission to access the site during maintenance mode via admin/people/permissions and check for this permission Use the site in maintenance mode. Default access will be given to the admin.

In Drupal 7, to create a custom maintenance page we have to override the default maintenance template file

We can do it by the following steps:

  • Copy maintenance-page.tpl.php from modules/system/
  • Paste it in active theme folder inside templates folder
    ie., sites/all/themes/your_theme/templates/
  • Make the changes in new maintenance template file.
  • Clear the Drupal cache - configuration > performance > clear all caches

Note:

  • If you want how to Put Drupal 7 in Maintenance Mode, you can go through this link

  • To bring the site back online

    • The user who has permission to access the site during maintenance mode can
      able to login using login page
    • Go to admin/config/development/maintenance and uncheck Put site into maintenance mode and save it.
1

double check that you have done the changes

Drupal API

And copied the file into your themefolder?

There is also the option of using maintenance-page--offline.tpl.php when the db is off.

1

If clearing your cache doesn't work, you can explicitly set the template in the preprocess.

     template_preprocess_maintenance_page(&$variables) {
      if (isset($variables['db_is_active']) && !$variables['db_is_active']) {
    // Dead databases will show error messages so supplying this template will
    // allow themers to override the page and the content completely.
        $variables['theme_hook_suggestion'] = 'maintenance_page__offline';
      }
      else {
    // Default maintenance template
        $variables['theme_hook_suggestion'] = 'maintenance_page';
      }
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.