help with omit-tag and object existence
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>
mclinden@informed.net wrote:
tal:omit-tag="not:exists:string:${item/id}/bio_text"
Yikes! Does Zope actually accept this without an error? (Tries it) Ah, so it gets treated as a degenerate path alternation. The string always exists, so the entire expression is always false. Have you tried this? tal:omit-tag="not:exists:item/bio_text" Cheers, Evan @ 4-am
participants (2)
-
Evan Simpson -
mclinden@informed.net