I used drush to create an Omega sub-theme. When the site is set to offline, the maintenance page is not including any CSS from the Omega sub-theme which is set as the default. I know that the Omega sub-theme is being used because my themes logo appears. A custom maintenance-page.tpl.php would also be handy so the CSS styles apply properly (the Drupal default maintenance-page.tpl.php does not produce html matching the rest of the site).

Cheers,

Antoine

CommentFileSizeAuthor
#31 omega-maintenance_page_css-1218568-31.patch502 bytesrooby

Comments

rodneireis’s picture

Same here. Subscribing.

desiostudios’s picture

Same here... also subscribing.

Dropper’s picture

I have the same problem - but I did my theme from scratch without Omega. This seems to be a more general problem...

Update: I found a Solution (not sure, if this here is the same Problem)

laraz’s picture

Where is the maintenance-page.tpl.php ? I can't find it.

Thanks.

DanGun’s picture

i am also missing a maintenance-page.tpl.php. still hoping to receive an answer, although this issue is quite old.

PCateNumbersUSA’s picture

Like to know as well.

marcoka’s picture

Assigned: Unassigned » himerus
Anonymous’s picture

I'd also like to see this feature!

RKopacz’s picture

Giving this a nudge. I am trying to put a site up with Omega. Trying to use the offline maintenance page as a "Coming Soon" page. Followed prior SOP and put a copy of the maintenance-page.tpl.php into subtheme folder, etc. Doesn't work. Anybody have any ideas on how to customize this page, and if there is anything special I need to do in Omega, would love to hear them.

elgandoz’s picture

A pro base theme like this really needs this basic feature. Following and subscribing and requesting...

krista_fredal’s picture

Could someone explain to me, a novice user of omega, how to modify the lay-out of the maintenance-page? For instance, I would like to insert an image and a link to the page. Where can I put this?

I think I should use the delta and context module, but it's not clear to me how to begin exactly?

Anonymous’s picture

If you know some HTML, just put an image (or whatever you want) in 'admin/config/development/maintenance'.

knalstaaf’s picture

I think this is a basic need.

The website looks totally unprofessional in maintenance mode.

I tried copying the page.tpl.php from the alpha folder to my theme folder (under "templates"), but that gave a blank page.

Instead I've put this in modules/system/system.theme.css for the time being:

/** maintenance page **/

.maintenance-page{
	background: #333;
	color: #fff;	
	font: 14px Arial, Helvetica, sans-serif;
}

.maintenance-page a{
	color: #D62026;	
	text-decoration: none;
}
WarZ’s picture

Well, u can add your custom stylesheet link into <head> tag in maintenance-page.tpl.php of your theme.
Example:

<link rel="stylesheet" href="sites/all/themes/YOURTHEME/css/YOURSPECIALSTYLESHEET.css"/>

It will work :)

WarZ’s picture

Code of my maintenance-page.tpl.php

<?php
/**
 * @file
 * Implementation to display a single Drupal page while offline.
 *
 * All the available variables are mirrored in page.tpl.php.
 *
 * @see template_preprocess()
 * @see template_preprocess_maintenance_page()
 * @see bartik_process_maintenance_page()
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
    <head>
        <?php print $head; ?>
        <title><?php print $head_title; ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" href="sites/all/themes/sad_but_true/css/offline.css"/>
    </head>
    <body>
        <div class="maintain">
            <div class="icon"></div>
            <p class="sorry">Your content</p>
            <p class="something"><a href="api.drupal.org" title="">Drupal API</a></p>
        </div>
        <div class="copy"><i><a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a></i> - 2012</div>
    </body>
</html>

And my stylesheet code:

body {
    color: #bdb7b1;
    background: #2d2d2d;
}
a:link {
    color: #fff;
}
a:hover {
    color: #fff;
}
a:visited {
    color: #fff;
}
.maintain {
    width: 550px;
    margin: 0 auto;
    margin-top: 20px;
    padding-bottom: 20px;
}
.maintain p.sorry {
    font-size: 30px;
    font-weight: bold;
}
.maintain p.something {
    font-size: 14px;
    font-style: italic;
    line-height: 26px;
}
.icon {
    background: transparent url(maintainicon.png) no-repeat top left;
    width: 128px;
    height: 128px;
    margin: 0 auto;
    border: 1px solid #777;
    -webkit-box-shadow: 1px 0px 5px 5px rgba(0, 0, 0, 0.4);
    box-shadow: 1px 0px 5px 5px rgba(0, 0, 0, 0.4);
}
.copy {
    width: 300px;
    margin: 0 auto;
    text-align: center;
    line-height: 40px;
}
knalstaaf’s picture

#15 works for me, thanks.

So in fact, the page code from #15 is not from a page.tpl.php in the Omega theme folder, but from the default Drupal theme?

cadoughe’s picture

knalstaaf, I think you can pick one of the maintenance-page.tpl.php files in any of the default themes loaded by Drupal [it looks like Seven and Garland each have one] and throw that in your templates folder in your Omega subtheme. I had to theme the tpl.php file with inline CSS, though, because even when I define a custom stylesheet to be called when in maintenance mode, it will only be applied to the inner pages of the site, not the maintenance page itself.

WarZ’s picture

#16,
Slighty modified, but it is.

cellar door’s picture

Category: bug » feature

Changing to a feature request. May not make it into 3.2 but would be good for future inclusion at some point.

mrfelton’s picture

Once cause of a broken maintenance page (when using maintenance-page--offline.tpl.php) is #1722586: Additional uncaught exception when site is offline, causes broken maintenance template.

mrfelton’s picture

Also note that if you are using an installation profile, and your theme lives in profiles/myprofile/themes, then you also need the following in your settings.php file:

$conf['install_profile'] = 'myprofile';

Po3t’s picture

Any progress on this yet?

roborew’s picture

Just thought I'd put in my solution for this scenario.. This doesn't require any coding and is also a useful practice when launching a site.

Instead of putting the site in offline mode use the Content Access module.

I've created a new content type called landing page and created one article for this content type. I've set this as the new Landing Page in the Site Settings. I've then limited the access to other content types to only authenticated and admin users. I have only one menu block to the left with the region 'force render' unchecked so that this new page fills the screen.

You could go further with the layout by either using the context and delta to play with the layout of the landing page. Or alternatively create some template files for the new Landing Page content type.

To take live I can adjust the access to the other content types, then edit the default landing page settings.

hope this helps

Po3t’s picture

I went with #15's option and modified the maintenance page code as necessary. Worked like a charm.

letrotteur’s picture

I've created a maintenance-page.tpl.php in my omega subtheme. So far so good. But I just can't get any of the theme or subtheme stylesheets! All scripts are loaded. So the question is:

Why ain't $styles variable loading any stylesheet of the theme or subtheme? I've looked at Garland and/or Bartik and both themes load themes stylesheet in the maintenance page. There might be something I'm missing out here.

glamdring’s picture

Title: Maintenance page missing themes CSS » Maintenance page missing and CSS
Version: 7.x-3.x-dev » 7.x-3.1

I was going crazy cause none of these worked in my subtheme, theme, or templates folder.

The only solution I found was to replace /modules/system/maintenance-page.tpl.php with my custom template. Just figured I would post in case anyone else had this problem.

ñull’s picture

The hooks in template.php are missing. I found a solution to at least a maintenance page for a subtheme.

  • I copied themes/batik/templates/maintenance-page.php to my omega sub-themes' template folder
  • I copied themes/batik/css/maintenance-page.css to my sub-themes css folder
  • I opened batik's template.php and copied functions batik_preprocess_maintenance_page and batik_process_maintenance_page into my sub-themes' template.php
  • I did a Search and replace from batik to my theme's machine name and saved my changed template.php

Result is that both theme and css file are used and that is what we wanted here, isn't it? I don't have the time to try it but may be it is sufficient that this is done in the Omega parent theme and that would then get in the direction of the feature patch we are looking for.

kpa’s picture

I had this issue as well, not being able to load stylesheets from my maintenance page. A simple hook fixed this:

/**
 * @file
 * To use alpha's preprocess structure, put this file into your theme as
 * preprocess/preprocess-maintenance-page.inc and change the subthemename
 * to be your own theme name.
 *
 * This added the stylesheets for me.
 */
function subthemename_alpha_preprocess_maintenance_page(&$variables) {
  alpha_css_include();
}

nerdoc’s picture

@kpa, this did not fix the issue I have here.

rooby’s picture

Title: Maintenance page missing and CSS » Maintenance page missing CSS
Category: Feature request » Bug report
Issue summary: View changes
Priority: Normal » Major

This is most definitely a bug, not a feature.

The maintenance page is an important part of Drupal core and for it to be broken is a bug.

rooby’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Assigned: himerus » Unassigned
Status: Active » Needs review
Related issues: +#1727986: No maintenance page in Alpha
StatusFileSize
new502 bytes

Comment #28 seems to fix the missing CSS. Here is a patch for that.

This issue also adds a default maintenance page template: #1727986: No maintenance page in Alpha