Stuff in the ‘Themes’ Category

Magento 1.6 Theming Error Pages

Saturday, May 1st, 2010

Over the past few years, I’ve had the mixed blessing of working with Magento.  It’s a spectacularly powerful open source ecommerce platform.  As a developer, I get to roll around in the dirty underbelly of this monster, and have learned more than a few things the hard way.

Recently, a client requested that the error page be themed to match the rest of the site.  (As an aside, this same client asked that the admin login be themed earlier.  At that time I told them no, but I’ve decided I’ll take that on soon.  I’m hoping it won’t be too bad!)

So, when I Googled Magento Error Page Theme, I didn’t find any current or relevant results.  They all pertained to older versions of Magento, and were not quite accurate.

To help anyone else out there who would like to theme their Magento Error page, I’ve put this together.  Magento has made it fairly easy, so here goes:

In your Magento installation, you will find a folder called errors.  Open that folder up.

Inside you will find a folder titled “default”. Copy it, and rename the copy to your theme name – for this example, lets use “customtheme”

In the errors folder, you will find several files.  The Magento team has been kind enough to give us a sample local.xml file titled local.xml.sample.  Change this file name to local.xml

Now open the local.xml file you just created, and edit the <skin>default</skin> setting to be the name of your custom folder you created above (in this example, “customtheme”)

Finally, open up the files inside of “customtheme” and edit them to your liking. The code that displays the image can be found in page.phtml, and the styles are in css/styles.css

That’s it. You can test them by browsing to them directly: http://www.example.com/errors/report.php, http://www.example.com/errors/404.php, etc.