1

I have my site in Maintenance Mode. I know I can get to my login page by going to http://example.com/login .

My client wants a login link on the Maintenance Mode page (when in this mode). Before I say "no this is not possible", I am wondering if this is possible. I could add this to the Maintenance template page right? I already have a custom Maintenance Mode page.

EDIT: Where the http://adaptivethemes.com/how-to-theme-the-user-login-page-in-maintenance-mode solution works, its not what I want. All I want is a link to the user login page displayed on the Maintenance Page.

I did try this: I added html to the maintenance php template: <div><a href="/user/login" >Login</a></div>

HOWEVER this only show a link that was NOT clickable. Also how would I get to the User login page if I am testing this on a test server, but the domain will be different than on the test server. Change the domain once on the production server?

1

Yes, you should be able to. You can create a maintenance page template similar to any other in Drupal, "maintenance-page.tpl.php". However, to get that to work you probably have to make some changes to your template.php file.

More info can be found here: http://adaptivethemes.com/how-to-theme-the-user-login-page-in-maintenance-mode although I believe that example is from Drupal 6, but the idea should be fairly similar for Drupal 7 as well.

  • The only issue I have your suggestion that it prompts user on maintenance page for user login credentials when all I want is a link. – Benjamin Jones Feb 14 '14 at 20:38
  • Ok as a temp solution I just added HTML to maintenance-page.tpl.php. – Benjamin Jones Feb 14 '14 at 20:43
  • @BenjaminJones I don't see why you wouldn't just be able to add a textual link then on the maintenance page to /user/login just as with any standard href link. – Jon Girard Feb 14 '14 at 23:24
0

Using the maintenance-page.tpl.php file is indeed a vaid approach for this. However if you use that approach, there are two maintenance page files that you should create. You can duplicate your theme's page.tpl.php twice and name them:

  • maintenance-page.tpl.php: This file controls the page that is displayed when the site is in "maintenance mode" but the database connection and database are still functioning correctly.
  • maintenance-page--offline.tpl.php: This file controls the page that is displayed when Drupal cannot access the database (for whatever reason).

For more details on this, and related changes in settings.php, refer to the community documentation about Theming the Drupal maintenance page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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