Video: Speed Up Joomla with mod_deflate - Yireo

Modules on the Joomla! offline page

Joomla! 1.5 introduced the possibility of overriding the default offline-template by copying the file offline.php to your own Joomla! template-directory. However, not so many people know you can also add module-positions to your custom offline-page.

Overriding offline.php

Within the Joomla! Global Configuration you can set your website offline. By default, this will display a little description (the Offline Message) to all your visitors. But it will also show a login-box. You might want to change this page - for instance, remove the login-box or add something else instead. This is possible by creating a template override of the systems default.

To create this template override, you will need to create a file named offline.php within the Joomla! template-directory. For instance, if I'm using a template called foobar I would create the following file:

templates/foobar/offline.php

Making changes

Now that you have your own copy, you are free to make any change. Easiest is to use the default offline.php file as starting point. Copy the contents of the following file to your own custom offline.php file:

templates/system/offline.php

Within the file you can find a little bit of PHP, but also HTML and other things. By copying parts of your index.php you can make the offline-page have the same look and feel as your final website. Most likely you'll want to change the logo and add better styling.

Adding an offline message with style

Now the cool thing is that you can also include module positions in this offline.php. This allows for much easier maintenance. For instance, you can remove the following line:

<?php echo $mainframe->getCfg('offline_message'); ?>

And instead add a module position called offline_message:

<jdoc:include type="modules" name="offline_message" />

Next you'll need to log into the Joomla! Administrator and browse to the Module Manager. Create a new Custom HTML module and configure the Position for this new module to be offline_message. Now you can customize the offline message by using an easy WYSIWYG-editor.

Customize the login-module

Instead of the ugly login-module you can also add a login-module instead using the same procedure. You can add a new module-position offline_login and use the Module Manager to assign the login-module to this position:

<jdoc:include type="modules" name="offline_login" />

More ideas

Other nice modules to put on this offline-page would be a newsletter-module. The only catch here is that if the module points to a second page, this second page is most likely unreachable because Joomla! is offline. This would require modification of the offline-procedure (which is not recommended) or you can opt for a newsletter-functionality outside of Joomla!.

Created on Monday, 01 February 2010
Modified on Saturday, 13 February 2010

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo