The template tag tpl:LoopPosition tests the actual state of a loop such as <tpl:Entries>, and allows execution of the included code as long as the condition's attributes are verified.
Note:
All template tags generating a loop on a recordset (posts, categories, archives, languages, comments, trackbacks) may be tested by this template tag.This attribute defines the start index from which the condition will be tested. Its value may be negative, in which case it will apply to the amount of remaining iterations.
This attribute defines the amount of iterations for which condition will be tested. Its value may be negative, in which case it defines the total amount of iterations minus its value.
This attribute defines the parity on which the condition is tested.
<tpl:Entries> <h3>{{tpl:EntryTitle}}</h3> <tpl:LoopPosition start="1" length="3"> <div class="post-content">{{tpl:EntryContent}}</div> </tpl:LoopPosition> </tpl:Entries>
<tpl:Entries> <tpl:LoopPosition start="-2"> <h3>{{tpl:EntryTitle}}</h3> <div class="post-content">{{tpl:EntryContent}}</div> </tpl:LoopPosition> </tpl:Entries>
<tpl:Tags> {{tpl:TagID}}<tpl:LoopPosition start="1" length="-1">, </tpl:LoopPosition> </tpl:Tags>
In this code, <tpl:LoopPosition>
allows to separate tags by comas, without having a coma after the last tag because of the attribute length="-1"
.
Wiki powered by Dokuwiki.