Criteria syntax

The loops criteria for are written between curly brackets just after the tables names.

<BOUCLE_name(TABLE){criterion1}{criterion2}...{criterion n}>

Any SQL field in a table can become a selection criterion separated by an operator. But other criteria can be created when necessary. They are defined in the ecrire/public/criteres.php file.

Some tags can also be used as criteria parameters, but it is not possible to use their optional components. In general, the use of square brackets is not possible:

<BOUCLE_name(TABLE){id_table=#TAG}> OK
<BOUCLE_name(TABLE){id_table=(#TAG|filter)}> OK
<BOUCLE_name(TABLE){id_table=[(#TAG)]}> Will fail

Example

This ARTICLES loop has 2 criteria. The first selects the articles where the "id_rubrique" SQL field in the "spip_articles" SQL table equals 8. The second criterion specifies that the results should be sorted in ascending order of those articles’ titles.

<BOUCLE_arts(ARTICLES){id_rubrique=8}{par titre}>
  - #TITRE<br />
</BOUCLE_arts>

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français