[Zope] Re: fill-slot condition possible?

Evan Simpson evan at 4-am.com
Mon Jan 26 14:34:28 EST 2004


Sune Brøndum Wøller wrote:
> is it possible when using a macro to conditionally
> fill a slot ? In the same template, that is...

It's sort of possible, but messy:

<div metal:define-macro="mymacro">
   Blah, blah...
   <div metal:define-slot="myslot"><metal:slot define-macro="myslot">
Default contents of slot
   </metal:slot></div>
</div>

<div metal:use-macro="template/macros/mymacro">
   <div metal:fill-slot="myslot" tal:define="filled some_condition">
<p tal:condition="filled">
   New Contents
</p>
<metal:slot tal:condition="not:filled"
  use-macro="template/macros/myslot" />
   </div>
</div>

Cheers,

Evan @ 4-am





More information about the Zope mailing list