title: how to use macros with pyramid / ZPT (Chameleon)
body: <p>I want to use macros with pyramid+ZPT engine (Chameleon).</p>
  
  <p>The docs say that "A single Page Template can accommodate multiple macros."
  <a href="http://chameleon.readthedocs.org/en/latest/reference.html#macros-metal" rel="nofollow">http://chameleon.readthedocs.org/en/latest/reference.html#macros-metal</a></p>
  
  <p>Thus I defined a file
  <code>macros.pt</code>:</p>
  
  <pre><code>&lt;div metal:define-macro="step-0"&gt;
    &lt;p&gt;This is step 0&lt;/p&gt;
  &lt;/div&gt;
  &lt;div metal:define-macro="step-1"&gt;
    &lt;p&gt;This is step 1&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and a global template <code>main_template.pt</code> with all the html stuff defining a slot <code>content</code>.</p>
  
  <p>and a template for my view <code>progress.pt</code> which uses <code>main_template.pt</code> to fill in the slot:</p>
  
  <pre><code>&lt;html metal:use-macro="load: main_template.pt"&gt;
    &lt;div metal:fill-slot="content"&gt;
      ...
      &lt;div metal:use-macro="step-0"&gt;&lt;/div&gt;
      ...
    &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So far I painfully found out, that I can not just say <code>use-macro="main_template.pt"</code> because Chameleon does not load templates automatically as Zope does. Thus I had to add the <code>load:</code> snippet before.</p>
  
  <p>Coming to <code>use-macro="step-0"</code>. This raises NameError for <code>step-0</code>. I tried to preload the <code>macros.pt</code> with something like <code>&lt;tal:block tal:define="compile load: macros.pt" /&gt;</code> but this didn't help.</p>
  
  <p>How can I use macros which are gathered in a macros summary file?</p>