Errors

Categories

Component ID

1281014

Component name

Errors

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

457

Component created

Component changed

Component body

Errors is a simple module that allows you to theme the 403 and 404 pages. Although this is a simple module, you'll require some basic understanding of HTML/PHP and how to override some theme files.

There is no UI with this module, just use your Theme to theme your templates the way you like it, this provides maximum flexibility.

Installation and configuration
Once you install this module, go to admin/settings/error-reporting and set the following paths:

- 403 : "error/403"
- 404 : "error/404"

To theme both pages you can create the following files in your theme:

- error-403.tpl.php
- error-404.tpl.php

You can also use preprocess to create your own variables:

<?php
function mytheme_preprocess_error_403(&$variables) {
  $variables['some_text'] = "Sorry, you don't have access to this page";
  $path = drupal_get_path("theme", "mytheme");
  $variables['image'] = theme("image", $path . "/images/someimage.png");
}

function mytheme_preprocess_error_404(&$variables) {
  $variables['some_text'] = "Sorry, the page you're requesting does not exist.";
}
?>