-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/05/2010 01:20 PM, Mark Phillips wrote: > I have a table and I am putting data into the cells using tal. I want to > bold the data under a certain condition. I tried this, but it didn't work: > > <td tal:content="string:${player/name}"><b > tal:condition="python:str(player['name']) == 'Team'">name</b></td> > > The data (player/name) appears correctly, but when player/name='Team', the > text is not bold. After some reading, I believe what is happening is that > the tal:content tag is replacing everything between the <td> and the </td> > tags. Is this correct? I tried this, and no bold either: > > <td tal:content="string:${player/GP}"><b>GP</b></td> > > which supports my hypothesis about the tal:content tag. > > How do I add some "conditional bold effect" in my table data?
You are correct that 'tal:content' on a wrapper element replaces any markup in the children. You want to use 'tal:content' on the 'b' tag itself, and then 'tal:omit-tag' to drop the element (but not its contents). See: http://wiki.zope.org/ZPT/TALSpecification14#omit-tag Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyrX78ACgkQ+gerLs4ltQ4tRQCfU0DN0AVeBSRg/wYjYFGcbAJL 8pUAn3x/KD8/qXdp4acpcIluuVnWvtrv =l0+r -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )