Criteria applicable to loops

Hi,
Two questions:
1:

How to combine the following criteria in one loop:
Display recent articles except articles of secteur 60 and articles of mot 38?

I tried the following, but it lists only the articles with mot/keyword:

<BOUCLE_articles(ARTICLES){!par date}{id_mot!=38}{id_secteur!=60}{id_rubrique!=1}{0,3}>


</BOUCLE_articles>

2: Is it possible to use {doublons} or {unique} in the loops of homepage/ sommaire.html? If yes, how?

Ref: https://www.spip.net/en_article2085.html

Thank you
Kamran

Hi,

you should try

<BOUCLE_articles(ARTICLES mots){!par date}{id_mot!=38}{id_secteur!=60}{id_rubrique!=1}{0,3}>


</BOUCLE_articles>

.Gilles

Le 04/06/2018 à 01:22, Kamran Mir Hazar a écrit :

How to combine the following criteria in one loop:
Display recent articles except articles of secteur 60 and articles of mot 38?
I tried the following, but it lists only the articles with mot/keyword:

/<BOUCLE_articles(ARTICLES){!par date}{id_mot!=38}{id_secteur!=60}{id_rubrique!=1}{0,3}>

AMOF you want {!id_mot=38} rather than {id_mot=38}

(that's because generaly speaking an article can have several MOTs
but it wont change in case your articles only have one MOT only or none)

try it with gille's advice also

JL

Thanks, but it doesn’t list the articles without mot/keyword.

It works for me like the following one:
<BOUCLE_articles(ARTICLES mots){!par date}{!id_mot=38}{id_secteur!=60}{id_rubrique!=1}{0,3}>

What about question two {doublons} or {unique} in the homepage?

Le 04/06/2018 à 12:49, Kamran Mir Hazar a écrit :

What about question two {doublons} or {unique} in the homepage?

spip.net explains quite well these criteria. isnt ?

in case you request help, plz explain what you're trying to do and what's the issue.

JL

Let’s say like this:
In the sommaire.html I have several loops. Two of the list most recent articles, one from mot 38 and another one from all sections except those with mot 38 and those in secteur 60 and rubrique 1 (First question in this email):

<BOUCLE_articles(ARTICLES){id_mot=38}{!par date}{0,1}>

{doublons} is like a bag :
you use it in one or several loops so it collects looped items

as you go in loops with {doublons}, spip checks whether the looped item
is allready in the bag. When it is in the bag, the loops doesnt stop
and doesnt output this item and goes immediately to the next item.

You can use this feature to build your page as you wish.
JL

Le 04/06/2018 à 13:18, Kamran Mir Hazar a écrit :

Let's say like this:
In the sommaire.html I have several loops. Two of the list most recent articles, one from mot 38 and another one from all sections except those with mot 38 and those in secteur 60 and rubrique 1 (First question in this email):

/<BOUCLE_articles(ARTICLES){id_mot=38}{!par date}{0,1}>
/
/ ----/
/</BOUCLE_articles>/

/<BOUCLE_articles(ARTICLES mots){!par date}{!id_mot=38}{id_secteur!=60}{id_rubrique!=1}{0,3}>
/
/ ----/
/</BOUCLE_articles>/
/
Now, in the same page sommaire.html, I have other loops listing articles from different sections or mots that their most recent articles are already listed in one of above loops. Like the following one:

/<BOUCLE_articles (ARTICLES){id_rubrique=46}{!par date}{0,1}>
/
/ -----/
/ </BOUCLE_articles>/

What I want is when article/s are listed by two first loops, they do not list by other loops in sommaire.html.
Hope this is a clear explanation.

On Mon, Jun 4, 2018 at 12:57 PM, JLuc <jluc@no-log.org <mailto:jluc@no-log.org>> wrote:

    Le 04/06/2018 à 12:49, Kamran Mir Hazar a écrit :

        What about question two {doublons} or {unique} in the homepage?

    spip.net <http://spip.net> explains quite well these criteria. isnt ?

    in case you request help, plz explain what you're trying to do and what's the issue.

    JL

    _______________________________________________
    spip-en@rezo.net <mailto:spip-en@rezo.net> -
    http://listes.rezo.net/mailman/listinfo/spip-en

Hi,
It doesn’t Works for me. For example, I have the following loop in my article page:

<BOUCLE_articles_rubrique(ARTICLES) {id_rubrique} {!par date} {0,10} {doublons}>

  • <a href="#URL_ARTICLE"[ class="(#EXPOSE)"]>#TITRE

  • </BOUCLE_articles_rubrique>

    In the same page, I have another loop coming inclure folder:

    <BOUCLE_articles(ARTICLES) {!par date} {!id_rubrique=12} {!id_rubrique=38}{!id_rubrique=76} {!id_rubrique=42} {!id_secteur=60} {!id_rubrique=98} {!par date}{0,5} {doublons}>

    Le 07/06/2018 à 12:32, Kamran Mir Hazar a écrit :

    In the same page, I have another loop coming inclure folder:

    doublon can be passed from including skeletton to included skeletton
    but includes dont receive doublons automaticaly :
    you have to pass them explicitely

    read https://www.spip.net/en_article5137.html reads

    (passing a doublon from included to including is not possible generaly speaking.
    this page states a special way to do it, but that's a corner case)

    I could pass a doublon from including skeletton to included skeletton of article.html, but not sommaire.html. It seems the same method doesn’t apply to the homepage.