Custom Theme the maintenance ("Site Offline") page
Drupal 6.x provides a 'built-in' phptemplate approach to theming the "Site offline" maintenance page - see http://drupal.org/node/195435
In Drupal 5.x, many posts have suggested hacking core to customize this theme, but this is a poor idea, not necessary, and doesn't even give a good result. Here are a couple of good approaches that were proposed by Nax (http://drupal.org/user/25511), each with its own advantages:
- Define a custom template file to theme the maintenance page: http://drupal.org/node/58562#comment-266358
- Advantage: integrated with theme; Uses the "Site off-line message" at admin/settings/site-maintenance so easy to configure and change message through admin interface.
- Define a static html page for the maintenance page, and then re-direct to it by inserting the following override into template.php:See http://drupal.org/node/58562#comment-281490
function phptemplate_maintenance_page($content, $messages, $partial) {
drupal_goto('path/to/your/site-offline.html');
}- Advantage: very simple; no need for custom theming for the maintenance page.
- Disadvantage: does not use the "Site off-line message" in the admin panel, so could confuse an admin who didn't set the site up.
Both of these methods work, so choose the one that seems best for your situation.
Some advice when developing your custom maintenance page:
- Remember that the site is offline - you can't make any calls, directly or indirectly, to the database - so be careful what you call.
- Remeber that your .htaccess files will limit the folders users can access, so be sure to put any static html into a folder users can access (like the root folder, for example).
If you have any suggestions or other methods for doing this, please post a comment here.
