[ZPT] Filling slots in METAL macros...
Tony McDonald
tony.mcdonald@ncl.ac.uk
Wed, 25 Jul 2001 18:12:38 +0100
Hi,
I must admit that ZPT is stretching my learning curve almost vertically. I
really like the idea of separating code from presentation, and some of the
things I've seen (such as '/here/%s/macros/main' % pick_a_style_for_output)
are *just* what I need. This is tempered by the fact that
At the moment I'm trying to replace some of the functionality of some Roxen
tags using ZPT and METAL.
I want to get to this
<div>
<table>
<th>my title (var1)</th>
<tr>
Lots of my data (var2 ... varn)
</tr>
</table>
</div>
In my obox page template, I have this..
<div metal:define-macro="obox">
...
<th><b metal:define-slot="var1">title for Obox</b></th>
...
</div>
I have tried this;
<html metal:use-macro="here/obox/macros/obox">
...
<div metal:fill-slot="obox">
</div>
This works, but it just replaces the <div>..</div> with the contents of the
obox macro.
I've tried this
<div metal:fill-slot="obox"
tal:define="var1 string:Hello World">
</div>
Renders the same thing (ie var1 is ignored).
I have looked through as much documentation as I can get hold of (the
tutorials, Peters stuff - very useful, the Wiki pages and as much of the
source as I could grok. I've scoured the mailing list for mention of 'metal'
and 'macro' etc, but am obviously missing something.
I'm stuck...
Tone
--
Dr Tony McDonald, Assistant Director, FMCC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 243 6140
A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope