[z3-five] (re)using zpt macros from view page templates

Chris Withers chris at simplistix.co.uk
Sun Jan 28 15:34:38 CET 2007


Andreas Jung wrote:
> 
>> Is that the canonical way? it seems pretty heavyweight in terms of
>> instantiating a whole view, with request and all, just to get a macro...
>>
> Isn't it sufficient to register the template through ZCML?

Yeah, that's not what I was talking about though...

If I did:

myview.pt
---------
<html metal:use-macro="context/@@my_macro">
<div fill-slot="foo">
blah
</div>
</html>

...then we're looking at least at an adapter looking, probably some 
security checks in the traversal, and who knows what else.

Is there anything wrong with just having the page template as a 
module-level global and importing from there?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the z3-five mailing list