pythonexternalchameleontemplate-metal

Loading Macros from Other Template Files in Chameleon


I have a Pyramid app that uses Chameleon for its templates.
I would like to create a master template page (say master.pt) that contains several macros that I user throughout the pages of my site.
I am trying to load these macros in different templates across my application, but I can't seem to do so - Chameleon's documentation indicates the following syntax:

<div tal:define="master load: ../master.pt" metal:use-macro="master" />

But this throws an exception. What is the correct syntax for including external macros in a Chameleon template?


Solution

  • In case anyone was wondering, since I am using Pyramid, the usage is a little different:
    http://docs.pylonsproject.org/projects/pyramid/1.0/narr/templates.html#using-zpt-macros-in-pyramid