Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Formatting style in templates

0 views
Skip to first unread message

Gervase Markham

unread,
Oct 29, 2001, 1:17:16 PM10/29/01
to
We need to talk about this, because templates are not the same as code.

The problem is that it's good to nest tags using indentation, but there
are often a large number of levels of tags. Here's what I propose:

2-space indent. Embedded code sections on their own line, in line with
outer tags. So:

<fred>
[% IF foo %]
<bar>
[% FOREACH x = barney %]
<tr>
<td>
[% x %]
</td>
<tr>
[% END %]
[% END %]
</fred>

I also recommend we turn on PRE_CHOMP in the template initialisation;
this prevents us bloating the resulting HTML with a load of whitespace
the client is just going to ignore. Combining that with the above
indenting scheme happens to produce nicely-formatted resulting source,
as well.

Gerv

0 new messages