[ZPT] container when called from METAL

Kevin Dangoor kdangoor@webelite.com
Wed, 8 Aug 2001 15:59:55 -0400


I'm not sure I agree with the way "container" is bound in this instance:

I have a "Box" instance that contains the following page template:
<html metal:use-macro="python: user.getTemplate().macros['master']">
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
   <div metal:fill-slot="main" tal:content="structure
python:here.content()">
    This is where the box content goes.
   </div>
  </body>
</html>

The macro referenced above is in a "Skin" object. It looks like this:
<html metal:define-macro="master">
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
<table>
<tr><td valign="top"> <div metal:define-slot="main">
    <h2><span tal:replace="here/title_or_id">content title or id</span>
        <span tal:condition="template/title"
              tal:replace="template/title">optional template id</span></h2>

    This is Page Template <em tal:content="template/id">template id</em>.
</div>
</td>
<td><table><tr tal:repeat="box user/pageboxes">
<td tal:content="structure python:
container.box(boxtext=user.getBox(box).content())">
Box goes here.</td>
</tr>
</table>
</td></tr>
</table>
  </body>
</html>


The Skin object contains another page template called "box".

I get an error when I view the first template (on the Box instance), because
"container" in the macro page is bound to the Box, not to the Skin. It seems
like container should be bound to the Skin instance, not the Box instance.
Or, is there something I'm missing about container?

Thanks,
Kevin