Skip navigation.

SPIP commits

Howto combine two loops with "anti-doublons"

, ,

The documentation of {doublons} explains how this criterion, like {unique}, enables you to exclude some elements from the results of a query.

However, {doublons} can do much more than that : like {unique}, it stores in an array the results from successive loops. But, with {doublons}, this array can be re-used later in another loop, thanks to a special criterion : {!doublons} (named "anti-doublons")

Example :
BOUCLE2 displays in a chronological order the titles of the articles that are either tagged with the keyword number 2, OR that has been writen by the author number 1.
<BOUCLE0(ARTICLES){id_mot=2}{doublons A} />
<BOUCLE1(ARTICLES){id_auteur=1}{doublons A} />
<BOUCLE2(ARTICLES){par date}{!doublons A}>#TITRE<br></BOUCLE2>

Howto redefine a single functionTip of the day : see every errors in SPIP

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies