Re: Customizing the Zope 404 page

Elizabeth Leddy <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <etPan.538e2b3b.374a3fe6.5e48@elizabeths-mbp>
My heeeeeeero! Thank you so very much Sir Laurence of the Greater Bay Area. I owe you a beer or my first born daughters hand in marriage, whichever comes first.

Cheers!

Liz
On June 2, 2014 at 7:11:02 PM, Laurence Rowe ([email protected]) wrote:

On 2 June 2014 17:02, Elizabeth Leddy <[email protected]> wrote:
Greetings Ploners!

I have been digging in very, very deep dark zope code and was wondering if anyone knows or has a link on how to customize Zope’s 404 page? This is super helpful for hosting many plone sites in one zope instance and the current not found doesn’t even have the right page type.

I think you can register an exception view too. I can't find an example for this but the code looking them up is here: https://github.com/zopefoundation/Zope/blob/41c2220b9aa5727367760dd7d34e4b342d6c2d11/src/Zope2/App/startup.py#L241 and this code here: https://github.com/zopefoundation/Zope/blob/41c2220b9aa5727367760dd7d34e4b342d6c2d11/src/Zope2/App/tests/testExceptionHook.py#L298

Ah, here it is, from http://old.zope.org/Products/Zope/2.11.2/CHANGES.txt/

Zope 3-based exception views can now be registered in ZCML for various exceptions that can be raised by Zope. Registering an exception view can be done like this:

          <browser:page
            for="zope.publisher.interfaces.INotFound"
            class=".view.SomeView"
            name="index.html"
            permission="zope.Public" />


Laurence

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.