Optional criteria with operators

The use of optional criteria may be combined with the use of operators under certain specific conditions. In particular, it is necessary for the variable which is being tested in the environment to have the same name as the criteria; for example, X in:
{X ?operator #ENV{X}}. Any operator can be used here, and you only need to affix a ? to the selected operator (leaving no space between the ? and the operator).

In the following examples, the test is performed only if the variable is present in the environment. Otherwise the criterion is ignored.

<BOUCLEx(TABLES){myvar ?operator #ENV{myvar}}>
<BOUCLEx(TABLES){myvar ?== ^#ENV{myvar}$}>
<BOUCLEx(TABLES){myvar ?!IN #ENV{myvar}}>
<BOUCLEx(TABLES){myvar ?LIKE %#ENV{myvar}%}>...

Example

To select the 10 most recent articles but with an "earlier publishing date" prior to the one in the current environment, or, failing that, simply the 10 most recent articles, use this loop:

<ul>
<BOUCLE_art(ARTICLES){date_redac ?< #ENV{date_redac}}{!par date}{0, 10}>
<li>#TITRE</li>
</BOUCLE_art>
<ul>

Author Paolo Published : Updated : 12/03/23

Translations : English, français, Nederlands