[Zope] metal Macros from PageTemplateFiles?

Tino Wildenhain tino at wildenhain.de
Wed Jan 19 09:15:22 EST 2005


On Wed, 2005-01-19 at 14:29 +0100, Robert Casties wrote:
> Is it possible (and how?) to use a procedure in a product to produce a 
> PageTemplate that defines a macro, that can be used in another PageTemplate?
> 
> I tried:
> 
>    class SomeClass(Folder):
> 
>      content_template = PageTemplateFile("/some/file/template.zpt")
> 
> and the direct ssignment to a variable works, but it is not exactly what 
> I need (I need to check with the actual instance).
> 
> But when I try to do:
> 
>      def content_template(self):
> 	pt = PageTemplateFile("/some/file/template.zpt")
> 	return pt
> 
> then the procedure is never called and I get an error in the ZPT that 
> tries to use the macro:
> 
>    Error Type: AttributeError
>    Error Value: content_templatemacros
> 
> Somewhere I read a vage reference to invoke "cook" but I don't know how.
> 

Read the answer I already gave to your identical mail (yesterday?) :-)

Regards
Tino



More information about the Zope mailing list