Submitted : {inverse}

**SPIP**

# Article submitted

The article "**{inverse}**
(https://www.spip.net/ecrire/?exec=article&id_article=6616)" is submitted
for publication. on Wednesday 7 October 2020.

* * *

## {inverse}

Wednesday 7 October 2020 , by [jack](.././?page=auteur&id_auteur=593&)

The criterion `{inverse}` causes the display in the reverse order of that
requested in the preceding criterion.

Criterion **`{inverse}`** provoque l’affichage dans l’ordre inverse de
celui demandé dans le critère le précédant. causes the display in the
reverse order of that requested in the previous criterion. For example:
while`{par date}` will display the items starting with the oldest, `{par
date}{inverse}` will display the list starting with the most recent.

Criterion `{inverse}` is therefore always used in association with a
previously specified sorting criterion. See also the page of the criterion
`{par ...}` (https://www.spip.net/ecrire/?exec=article&id_article=6376).

If the sort criterion is *multiple*, for example: `{par titre, date}` which
first asks for an alphabetical sorting of the titles (from A to Z) and
then, for identical titles a (sub)sorting by date (from the oldest to the
most recent), the application of the criterion `{inverse}` (thus writing
`{par titre, date} {inverse}`) will reverse the order only on the last
specified sort field (here : data which will be ordered from the most
recent to the oldest) and will keep the default order on the previous
fields (here: text will remain ordered from A to Z).

If you want to specify a reverse order for the two fields concerned, you
will have to write:
`{par titre} {inverse} {par date} {inverse}`.

Since S P I P 1 . 9
(https://www.spip.net/ecrire/?exec=article&id_article=3416), citerion
`{inverse}` can take as parameter any tag to vary *dynamically* the sorting
direction.
For example, it is possible to write:
`<BOUCLE_exemple(ARTICLES) {par #ENV{tri}} {inverse #ENV{senstri}}>`
which allows you to choose the sort column and the sort direction given by
the url; for example: `tri=titre&senstri=0` which is equivalent to `{par
titre}` ou `tri=date&senstri=1` which is equivalent to `{par date}
{inverse}`.

**P.S.**
Voir aussi le critère `{par ...}`
(https://www.spip.net/ecrire/?exec=article&id_article=6376)

— Sent by SPIP (https://www.spip.net/)

rubon199-7e493.jpg