![]() |
iWebPress: User Guide |
In the example above, you had to manually specify which elements you wanted to output. You can, however, also abbreviate this. Abbreviating a list requires understanding the semantics of the list keyword. A list keyword has three possible arguments:
%variable(element/list type, start element, number of elements)%
The first is the element in the list you want to access. In the example above, this was 1, 2, ..., 5. The second argument specifies which element to start at. Finally, you can specify how many elements you want to repeat. However, if you wanted to say represent elements 1-5, you can specify the following:
%sectionName(SL,1,5)%
%sectionName(EL)%
This would output the top five sections, starting at section 1 and ending at section 5. This is called a dynamic list. The SL and EL keywords represent "Start List" and "End List". They are both necessary to tell iWebPress how you want the list repeated. iWebPress detects you had a new line (<br />) between the two elements, and will use that to repeat the list. You can, however, repeat the list however you see fit. If you had wanted a comma separated list you could use the following:
%sectionName(SL,1,5)%, %sectionName(EL)%
Hopefully you're starting to see the power of list keywords. Since iWebPress does not care how you repeat your list keywords, you can essentially create a design and have it expand seemingly automatically. The examples section below uses tables to demonstrate repeating keywords, and provides several good examples to help familiarize you with the list keywords.