[ZPT] Re: creating a definition list with tal
Tres Seaver
tseaver at palladion.com
Wed Apr 19 16:52:32 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
gf wrote:
> On 4/19/06, Tres Seaver <tseaver at palladion.com> wrote:
>>Another common practice is to introduce an element in the 'tal'
>>namespace to group the repeated elements; such tags are automatically
>>omitted when rendered. E.g.:
>>
>> <dl>
>> <tal:loop tal:repeat="finfo folder_info">
>> <dt><a tal:attributes="href finfo/url"
>> tal:content="finfo/alias">THE_TERM</a></dt>
>> <dd tal:content="finfo/summary"THE_DEFINITION</dd>
>> </tal:loop>
>> </dl>
<snip>
> I'm a zpt and zope newbie, so please forgive my ignorance. Does what
> you recommended mean that if I have no need for a 'real' tag, I can
> create and use a 'tal'-based tag like you did in your example? Does
> the element 'loop' have any special meaning?
Nope, it merely indicates the purpose.
> It seems as if using 'div's and 'span's just to hold tal directives is
> not a great idea (even if they can be 'omit-tag'ged away), or am I
> missing something?
I generally avoid 'omit-tag', mostly because "real" HTML elemets which
are present in the template but not the output can cause CSS to render
differently. It is more a matter of taste than anything else.
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFERqMQ+gerLs4ltQ4RAj/fAKCDo5yjA2LQo8/mbHjuuE/QuydC5wCgzjp6
OgwgCEqEkdGZY9XRmv6sllA=
=lZM7
-----END PGP SIGNATURE-----
More information about the ZPT
mailing list