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

Chris Withers chris at simplistix.co.uk
Tue Jan 30 13:05:57 CET 2007


Chris Withers wrote:

> Any help greatfully received!

> from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile

This was my mistake, that should have been:

from Products.Five.browser.pagetemplatefile import \
     ZopeTwoPageTemplateFile

However, now using the right class...

my_macro = ZopeTwoPageTemplateFile('my_macro.pt')

my_macro.macros just gives me a ComputedAttribute object (rather than 
the macros I'd expect).

If I do, my_macro.pt_macros(), I get the macros.

Why isn't ComputedAttribute working in this example?

cheers,

Chris

PS: Still interested in this too:
> PS: Putting this together, I noticed another thing... am I right in 
> thinking that:
> 
> <five:traversable class="OFS.Application.Application" />
> 
> ...doesn't work? As you'll see in the minimal example, I had to bind to 
> OFS.Folder.Folder instead and then create a dummy folder so I could test 
> the view in a browser.
-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the z3-five mailing list