Actions

Custom error pages

From Joomla! Documentation

Revision as of 18:27, 14 January 2008 by Chris Davenport (Talk | contribs)

Custom error pages

The standard system error pages can be overriden by adding specially-named and constructed files to the template directory. For example, this could be used to style the error pages so that they match the style of regular pages for the template.

Placing one or more of the following files into the templates/<template-name> directory will override the similarly named file in the templates/system directory.

  • templates/<template-name>/403.php (HTTP Status code: 403 Forbidden)
  • templates/<template-name>/404.php (HTTP Status code: 404 Not Found)
  • templates/<template-name>/500.php (HTTP Status code: 500 Internal Server Error)
  • templates/<template-name>/component.php (not sure when this is used)
  • templates/<template-name>/offline.php ("Site is offline" error page)

To render the error backtrace information when debugging mode is on you can call the renderBacktrace method like this:

<?php if ($this->debug) :
        echo $this->renderBacktrace();
endif; ?>

Note that jdoc:include elements are not parsed in these error pages.