[Zope] Custom 404 html message

Richard Jones rjones@ekit-inc.com
Tue, 19 Feb 2002 09:59:29 +1100


On Mon, 18 Feb 2002 21:29, Richard Barrett wrote:
> At 19:13 14/02/2002 +0000, Chris Withers wrote:
> >Richard Barrett wrote:
> > > Taking the basic standard_error_message and changing like this might
> > > work:
> > >
> > > <dtml-if "error_type == 'NotFound'">
> > >      <dtml-comment>
> > >         Add special handling for 404 Not found here
> > >      </dtml-comment>
> > > <dtml-else>
> > >      <dtml-comment>
> > >         Put the contents of the default standard_error_message DTML
> >
> > method here
> >
> > >      </dtml-comment>
> > > </dtml-if>
> >
> >*vomit* ;-)
>
> Excellent. Well framed constructive explanation for your objections.

I concur with his excellent, concise argument against DTML-as-logic :)


> >Put a python script in which calls the appropriate ZPT for an error
> > message or have the python script do other processing (such as a
> > redirect) if you don't want an error message shown.

Sorry, missed this comment when it was originally posted. Don't forget that 
most current Zopes won't let you use a Python Script as your 
standard_error_message - it MUST be a DTML Method - no other meta_type will 
be recognised. This has been fixed in 2.5 and _possibly_ 2.4.4(?)


    Richard