Charlie Clark wrote:
I've defined and configured a layer and it works when called by ++skin++ traversal but I have problems if I configured views to work with it explicitly: I get "not found" errors.

ie.

    <browser:page
        for="Products.Charlie.event.interfaces.IEventDetail"
    layer="Products.Charlie.skin.ICharlieSkin"
        name="detail.html"
        template="detail.pt"
        class=".detail.DetailEdit"
        permission="cmf.ModifyPortalContent"
    />

fails for /@@detail.html but

Right. This will look up the 'detail.html' view for (context, request). Now it depends on what layers the request has applied to. Unless you've changed anything in the default skin configuration, it will have Zope's default skin. Since the 'detail.html' view above wasn't registered for the default layer but for soemthing else, it's not found.

    <browser:page
        for="Products.Charlie.event.interfaces.IEventDetail"
        name="detail.html"
        template="detail.pt"
        class=".detail.DetailEdit"
        permission="cmf.ModifyPortalContent"
    />
is fine with /++skin++charlie/@@detail.html

Yup, because if you don't specificy a layer explicitly, <browser:page /> will register a view for IDefaultBrowserLayer. Your charlie skin probably inherits from IDefaultBrowserLayer (either directly or indirectly). That's why this works.

Of course, this ties in with what I get from Zope - that the adapter can't be found. I suspect I've misunderstood something fundamental on how views work with layers.

My book has a large section devoted to this. :)

Regarding CMFDefault - all views are registered explicitly for ICMFDefaultSkin but I think this isn't necessary as this is configured as the default skin.

No, it *is* necessary, because the default skin can always change. In fact, nearly every application (in the Zope 3 world) sets the default skin (otherwise you'd need those hideous ++skin++ things in all URLs).

Also, by explicitly putting all views on the ICMFDefaultSkin layer, those views are only there if your skin interface inherits from ICMFDefaultSkin. Which means you can easily "switch off" those CMF views by not including ICMFDefaultSkin. For some people this is an important use case.

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to