Upgrading Site and all extensions to lastest Joomla 2.5. Template Download will be closed for some days

Customizing Joomla!'s Error Page PDF Print E-mail
Written by Administrator   
Monday, 25 October 2010 18:39
In pursuit of the optimal user experience, I usually want to control each aspect of a view. And as there is much more to a good site than a nice colour palette or a funky header image, my interference with an extension’s existing layout goes beyond the scope of CSS alterations. I like to meddle with my site’s views by customizing any output that is generated and that includes Joomla!’s error page.

 

f7b9be29873ad525695063e6e748eae3_L

We all put enormous effort into designing websites that stand out from the crowd, and yet we often overlook the opportunity that the error page hands us. The error page has huge potential. Not only does a well-styled error page tell your visitors that you have an eye for detail, it can also convey a message or enforce an impression. At that, Joomla’s error message is shockingly simple to adapt. Here’s how…

Joomla!'s default error message

The file that renders the error message is located in your templates folder, in a folder named ‘system’. The file is appropriately named ‘error.php’. You need to make a copy of this file and save it into your template’s folder. For this example I have duplicated the Rhuk Milkyway template to which I will be adding the custom error page.

Remember to assign your template from the administrator!

Never alter a default template, whether it’s one of Joomla!’s core templates or an other third party’s template. Always create a copy of the template first and make your alterations to the copy. This way you will never lose your changes after an update.

This is what your error page looks like now:

joomla_default_404_page

Design your new error page

Now this is where the fun begins. If you googled for – say – “cool error pages” you would retrieve an enormous amount of funny, cool, beautiful and even very useful error pages. I have even seen error pages that sponsor charity. The only limits are the bounds of your own creativity. One word of caution though: the idea is to not scare your visitors away. Also, always provide a link to either a homepage, a search page or some other page so your users can find their way back to your site’s content.

For this example, I have prepared a little design featuring a hungry hippo (see image above). Now it's time to put some HTML in place. There's a number of ways in which you could build this design. I have taken the easy road and cut the design up in two images, one for the background and one that will serve as the link back to the homepage. I have saved the images in my template's image folder. Have you looked at the HTML of the default error page yet? Not much in there hey? This is what my new, customized HTML looks like:

joomla_error_page_html

See how little PHP code is in there? It's all copy/pasted from the original error.php (in /template/system) so really there's nothing to fear. Although we don't need it for the public view I have also kept some debug info, just in case. Now all that’s left is to put some CSS styling in place.

Add some CSS

It’s up to you how to implement your stylesheet. If your error page re-uses some of your template’s styling, you may want to include a link to that stylesheet. You can even copy the stylesheet from the system folder, which ever serves you better. For this example I have create a file called ‘error.css’ in my template’s css folder and added the following code:

* {
font-family: helvetica, arial, sans-serif;
font-weight: normal;
font-size: 1em;
color: #000;
}

html {
height: 100%;
margin-bottom: 1px;
}

body {
margin: 0px;
padding: 0px;
height: 100%;
background: #f6ac1e;
}

#outline {
width: 911px;
padding-top: 230px;
background: url(../images/error_hungryhippo.gif) no-repeat 0 50px;
}

#errorboxoutline {
margin: 0px;
padding: 0px;
}

#errorboxbody {
text-align: left;
height: 250px;
position: relative;
}

#errorsafelink {
float: right;
position: absolute;
right: 0;
bottom: 0;
}

#errorsafelink a {
float: left;
}

#errorsafelink img {
border: 0;
}

#techinfo {
margin: 10px;
padding: 10px;
text-align: left;
border: 1px solid #CCCCCC;
color: #CCCCCC;
}

#techinfo pre {
color: #CCCCCC;
}

Triggering the error page

Now of course your website runs fab, and it never renders an error (yeah, sure). But since we want to see the error page in all it fabulous glory, you will have to feed your browser a url that will trigger an error.

Feeling lazy? Download the code from this example, links are available at the bottom of the article. Need some more inspiration? Try some of these pages, their loaded with cool 404 designs:

Download attachments:

  1. Error page code

  2. Error page CSS

Author :Babs Gösgens. Joomla magazine


Administrator
Written on Monday, 25 October 2010 18:39 by Administrator

Viewed 6217 times so far.
Like this? Tweet it to your followers!


Newer news items:
Older news items:

Comments (0)Add Comment

Write comment

security code
Write the displayed characters


busy
Last Updated on Monday, 25 October 2010 19:24
 

Most downloads in 10 days

calendar.gifMay.20

a free Joomla template for travel

calendar.gifAug.01

Today Joomlapanel are pleased to announce the release of  Free JP Dreamland Template, the 5th Te...

calendar.gifMay.23

DS BUSUIT ARRIVED.The waits are finally over. With the long wait for the DS Busuit, now the beta...

calendar.gifJul.31

i-Business is a Joomla 1.5 native template. This is a clean and lightweight template.i-Business a...

Extensions stats

The download archive contains currently 143 downloads in 24 categories. To date, these have been downloaded 138302 times.

Blog Tips

Blog News
SEO Tips

Newest Files

calendar.gifMay.23

This Amazing Template design is delivered with the Following. 18 Module Positions CS...

calendar.gifMay.23

DS BUSUIT ARRIVED.The waits are finally over. With the long wait for the DS Busuit, now the beta...

calendar.gifMar.01

Latest Free Template From Joomvision

calendar.gifMar.01

Today Joomvision are pleased to announce the release of Free JV 9BodyTemplate

Online

We have 109 guests and 1 member online

If you Are finding premium Joomla templates You should try Template monster


Hosting a Website-Web Hosting Tutorials - Web Hosting Reviews & Guide About Hosting a Website

Latest Comments