[Zope] Integrating METAL into Zope Product

Peter Bengtsson peter at fry-it.com
Wed Jan 10 15:26:41 EST 2007


Define it as a class attribute

class MyProduct(...):

    ptMaster = PageTemplateFile('ptMaster', globals())
    index = PageTemplateFile('index', globals())

ptMaster.pt will then have to look like this::

  <html metal:define-macros="headerfooter">
  <body metal:define-slot="body"></body>
  </html>

and index.pt::

  <html metal:use-macros="here/ptMaster/macros/headerfooter">
  <body metal:fille-slot="body">BODY!</body>
  </html>


Brian Brinegar wrote:
> I've got a Zope product which will render itself using
> standard_html_header and standard_html_footer if they exist. I would
> like this same product to look for a specific Page Template (ptMaster)
> and render itself using a macro and filling a slot with it's contents.
> 
> Any pointers/examples on integrating METAL into a product?
> 
> Thanks,

-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


More information about the Zope mailing list