TALES repeat variables
The TALES repeat variable is one of the built-in root variables
which are common to all pages. It provides read-only access to information about the current iteration of a
tal:repeat
repetition.
When a TAL repeat attribute is used, two variables are created of the same name: A local variable, added to the
TALES context, and a repeat variable available under the repeat
root variable. The repeat variable
contains the following members:
Name | Description |
---|---|
index |
The numeric item-number, starting from zero |
number |
The number item-number, starting from one |
even |
true if the current number is an even number (divisible by two),
false otherwise
|
odd |
true if the current number is an odd number (not divisible by two),
false otherwise
|
start |
true if the current item is the first iteration,
false otherwise
|
end |
true if the current item is the last iteration,
false otherwise
|
length |
The count of all iterations (note that this will be the same for every iteration) |
letter |
An alphabetic representation of
number , in lowercase.
|
Letter |
An alphabetic representation of
number , in uppercase.
|
Alphabetic representations
Alphabetic representations of numberic values begin with the letter "a", representing 1. They continue with "b" = 2, "c" = 3 and so on.
After "z" = 26, the sequence begins again with an additional character, where "aa" = 27, "ab" = 28 and so on. Thus, 82 would be represented by the sequence "cd". After "zz" = 702, the sequence continues with "aaa" and so on.