[BlueBream] Exception views
Justin Ryan
justin.ryan at reliefgarden.org
Sun Jul 18 13:32:58 EDT 2010
Hiya and thanks for the response..
On Sun, Jul 18, 2010 at 6:52 AM, Michael Howitz <mh at gocept.com> wrote:
> Am 17.07.2010 um 23:23 schrieb Justin Ryan:
>> Howdy..
>>
>> I'm trying to override Unauthorized errors with a page, ideally a
>> login page, but for now I'm just trying to get a template which says
>> "Login required" to load.
>>
>> In a default bluebream paster project, I added the following ZCML:
>>
>> <browser:page
>> for="zope.exceptions.IUnauthorized"
>> name="index"
>> permission="zope.Public"
>> template="unauth.pt"
>> />
>>
>> Of course, there's an unauth.pt which, again, just says "Login
>> Required" for now.
>
> Maybe your declaration is missing the layer definition. When your application uses a specific skin you have to declare it in the ZCML statement otherwise the page is registered for zope.publisher.interfaces.browser.IDefaultBrowserLayer. See [1] for a package defining custom error views in its browser package.
>
Worth a shot, though I have piles of other views registered in the
actual project. I just made sure to reproduce in a fresh BB so there
were few variables..
I learn best by example, so thanks for the link. I've been digging
all over for some working code. :)
> The name of your view differs from the one in the wiki you mentioned. I'm not sure whether it is required to be "index.html"
>
Good attention to detail. :)
In default BlueBream paster, 'index' is set as the default view name,
so that *should* be right.
At least, that's the assumption set I'm operating under. I'll see
what I can do about incorporating your advice.
Thanks!
Justin
More information about the bluebream
mailing list