[Zope] metal Macros from PageTemplateFiles?

Robert Casties casties at mpiwg-berlin.mpg.de
Wed Jan 19 08:29:49 EST 2005


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.

Thanks
	Robert




More information about the Zope mailing list