[Zope] Customizing Error pages?

Dragos Chirila d.chirila at bucarest.finsiel.ro
Fri Jan 9 12:12:29 EST 2004


Hi

I wanted to display a custom error page for 'NotFound' and 'BadRequest'
errors.
First, I created in the ROOT a DTML method called 'error_html'.

So in the ROOT's standard_error_message above the lines

<dtml-if error_message>
 <dtml-var error_message>
<dtml-else>

I added the following lines:

<dtml-if "error_type in ['NotFound', 'BadRequest']">
    <dtml-call expr="RESPONSE.redirect('/error_html?error_page=' + URL +
'&error_type=' + _.str(error_type), lock=1)">
</dtml-if>

Hope this will help

Dragos

> In response to Paul Winkler (because I'm no good with mailing lists).
>
> I've tried modifying standard_error_message, and it seems like it works
> sometimes. My impression of it is that standard_error message picks up
> Zope Errors, but there is some other template somewhere which picks up
> Site Errors. Interestingly enough, the Site Errors template will
> attempt, to a degree, to make use of the standard_error_message.
>
> I guess I will do some searching and see if a solution to this pops up.
>
> Thanks,
>
> Alec
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>




More information about the Zope mailing list