[Zope] Re: ZPT: conditional omitting of a tag

Dieter Maurer dieter@handshake.de
Wed, 29 Jan 2003 21:33:52 +0100


martin f krafft wrote at 2003-1-29 13:36 +0100:
 > also sprach Sidnei da Silva <sidnei@x3ng.com> [2003.01.29.1326 +0100]:
 > > I may be wrong, but I think you want something like this:
 > > 
 > >    <a href="#" tal:attributes="href person/homepage"  
 > >       tal:omit-tag="person/homepage">
 > >      <span tal:replace="person/name" />
 > >    </a>
 > 
 > This works, but it also causes the contents (person/name) to be
 > omitted. I would like the <span> tag to stay and just have the <a> tag
 > around it iff person/homepage is non-empty.
Then you should use "tal:content" rather than "tal:replace"...

Maybe, rereading the TAL documentation is a good idea...


Dieter