[ZPT] tal:condition, how to eliminate containing tag?

Brad Clements bkc@murkworks.com
Sun, 27 May 2001 16:22:18 -0400


I need to apply a single condition test to a static element and a loop.

Here's what I have:

<span tal:define="wt here/WoodTypes"
   tal:condition="python:'soft' in wt">
<h3>Soft Wood Types</h3>
<span tal:repeat="typ here/SoftWoodTypes" 
      tal:replace="structure string:$typ<br />">ficklmire</span>
</span>


Two uglies with this

1. The outer span remains in the html. What I'd like is something like

 tal:replace="structure contents"

In the outer span so that it's not included in the output. "contents" means the children of 
this html element.



2. see the ugly use of 

tal:replace="structure string:$typ<br />"

I wish there was a better way to do this, though I'm not sure what. I had previously used 
a span as the repeat, but again I couldn't eliminate the outer span .. it was ugly.

If I had a tal:replace="structure contents"  then that would fix this.

Perhaps I'm missing something?


Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements