[Zope] help with omit-tag and object existence

mclinden@informed.net mclinden@informed.net
Wed, 11 Jun 2003 14:06:29 -0400


I have the following code which I want to behave in the following way:

If the folder contains an object named "bio_text", create an <a>, 
otherwise, simply print the text.

I have tried various templates using the tal:omit-tag operator with no 
success (meaning that I have not found the right clause to omit-tag to 
cause it to not print the tag when the object doesn't exist.

Help is appreciated.

Sean McLinden
Allegheny County Health Department

"" the ploneFolders method returns all items with objectValue=Plone Folder 
in the container

  <tr tal:repeat="item container/ploneFolders">
    <td><img width="100" src="/junk/junk.gif" tal:attributes="src 
string:${item/absolute_url}/bio_pic" /></td>
    <td>
       <a href="junk" target="_blank"
           tal:omit-tag="not:exists:string:${item/id}/bio_text"
           tal:attributes="href string:${item/absolute_url}/bio_text">
       <span tal:content="item/title">Title</span></a><br />
    </td>
    </tr>