Members

Note: You can use your Sitellite.org account here and vice versa.

Username

Password

Remember Login

Forgot your password?

Not a member? Click here to register

Custom Error Handler

Home Page | All Pages | Recently Revised | Authors | Feeds |

You can create your own page not found handler by changing the error_handler value in inc/conf/config.ini.php (or under Control Panel > Admin > Site Settings). The default one you see simply imitates an Apache 404 response.

Let's create a new box under inc/app/webapp/boxes/error with the following files:

inc/app/webapp/boxes/error/access.php

sitellite_access = public
sitellite_status = approved
sitellite_action = on

inc/app/webapp/boxes/error/index.php


<?php

page_title ('Page Not Found');

echo template_simple ('error.spt');

?>

inc/app/webapp/html/error.spt

<p>The page you requested was not found.  Perhaps you
can find it using our <a
href="{site/prefix}/index/sitellite-nav-sitemap-action">site
map</a>.</p>

<p>It may be that you must be logged in to view the
requested page.  To log in, use the form below:</p>

{box sitemember/login}

Now change error_handler to webapp/error to point Sitellite to your new handler. This will display a page that looks like the following:


Page Not Found

The page you requested was not found. Perhaps you can find it using our site map.

It may be that you must be logged in to view the requested page. To log in, use the form below:

Username: [________]

Password: [________]

[Enter]


Revised on August 30, 2006 10:07 AM by anonymous

Back in time (2 more) | Linked from: Boxes, Miscellaneous