[Zope] Preserving Context

Dieter Maurer dieter at handshake.de
Sun Dec 17 04:35:01 EST 2006


Javier Subervi wrote at 2006-12-11 00:41 -0800:
>I have a page template which I use to catch and customize 404 errors. In that page, I call a script that offers site navigation.

This is quite a difficult situation:

  In case of 404 errors, you may not yet have reached the final destination
  (as something in the url is problematic -- and the problem does not
  need to be at the url's end).


Within the restrictions of the problem sketched above (only very high
intelligence can try to overcome them), I would approach your case
in the following way:

  Have a trivial script in each context where you are interested
  in special treatment of 404 errors.
  As the script is trivial, there is no problem, in having
  a separate copy in each context.

  The trivial script determines the error context and
  then calls your centralized (non-trivial) script passing
  in the determined context.
  

-- 
Dieter


More information about the Zope mailing list