[ZPT] Macro expansion and slots

Jeff Peterson jpeterso@rangebroadband.com
Tue, 18 Feb 2003 10:21:04 -0600


I have been out of the loop as of late and haven't done much in the way of
Zope, but I am starting a new project now and have found that with newer
versions of Zope, metal slots are behaving differently than before. This
particular project will be built on Zope 2.51 on Linux, but I see the
behavior also on 2.6 and 2.61 on Windows.

All that I know about ZPT and all I can seem to find in the way of documents
and How-To's show slot behavior thus:

Macro:

<html>
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
    <div metal:define-macro="template">
      <p metal:define-slot="para">
        Test
      </p>
    </div>
  </body>
</html>

Expanded in Template:

<html>
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
    <div metal:use-macro="here/master/macros/template">
      <p metal:fill-slot="para">
        Test
      </p>
    </div>
  </body>
</html>


Where everything in the fill-slot is editable.  However I now see this
behavior:

Expanded in Template:

<html>
  <head>
    <title tal:content="template/title">The title</title>
  </head>
  <body>
    <div metal:use-macro="here/master/macros/template">
      <p metal:slot="para">   <<-- not "fill-slot" as above
        Test
      </p>
    </div>
  </body>
</html>

And as such the content is not editable unless I change it to a fill slot,
which strikes me as funny, since I really shouldn't be able to edit the
template in place.

Can anyone shed some light on this?

TIA,

Jeffrey D. Peterson
Webmaster
Range TV Cable & Broadband
jpeterso@rangebroadband.com