**SPIP**
# Article validated
The article "**{inverse}** (https://www.spip.net/en_article6616.html)" was
validated by <multi>[ar]جورج[fr]George [en]George</multi>.
* * *
## {inverse}
Saturday 10 October 2020 , by [jack](.././?page=auteur&id_auteur=593&)
The criterion `{inverse}` reverses the sort order of the previous
criterion.
The criterion `{inverse}` reverses the sort order of the previous
criterion. For example: while `{par date}` will sort the items starting
with the oldest, `{par date}{inverse}` will sort 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).
In the case of *multiple* sorting criteria, for example: `{par titre,
date}` which sort first alphabetically on the titles (from A to Z) and
then, for identical titles sort 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
sorting field (here: date which will be sorted from the most recent to the
oldest) and will keep the default sorting order on the previous fields
(here: titre will remain sorted 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), the citerion
`{inverse}` can take as argument any tag that will modify *dynamically* the
sorting direction.
For example, it is possible to write:
`<BOUCLE_example(ARTICLES) {par #ENV{tri}} {inverse #ENV{senstri}}>`
which allows you to choose the sorting column and the sorting direction
given by the url; for example: `tri=titre&senstri=0` which is equivalent to
`{par titre}` or `tri=date&senstri=1` which is equivalent to `{par date}
{inverse}`.
**P.S.**
See also `{par ...}`
(https://www.spip.net/ecrire/?exec=article&id_article=6376)
— Sent by SPIP (https://www.spip.net/)
![]()