A loop declares both a database table from which to extract information as well the criteria for selection.
<BOUCLE_loopname(TABLE){criterion1}{criterion2}>
... for each object ...
</BOUCLE_loopname>
Every loop has a name (which must be unique within the template file), this name is used together with the word “BOUCLE” (English: "loop") to mark the start and the end of the loop. In this example, the loop’s name is “_loopname”.
The table is specified either by an alias (written in capital letters) or by the real name of the table (matching the case), for example “spip_articles”. The example uses the “TABLE” alias.
The next components of a loop are the criteria, each of which are always written enclosed in braces. For example, the criterion {par nom}
will sort the results according to the “nom” column of the database table.