SPIP-Contrib

SPIP-Contrib

عربي | Deutsch | English | Español | français | italiano

273 Plugins, 191 contribs On SPIP-Zone, 29 visitors now

Homepage > Site navigation > Tris conditionnels > Excluding items with a particular keyword.

Excluding items with a particular keyword.

22 January 2007 – by Loiseau2nuit

All the versions of this article: [English] [français]

This loop enables your site to avoid displaying some items (section, article, news, ...) if they have been marked with a specific keyword.

This loop follows on from the one explained here: Displaying items with a specific keyword


<BOUCLE_exclude (ARTICLES) {titre_mot=excluded} {doublons}>
</BOUCLE_exclude>

<BOUCLE_display_non_excluded (ARTICLES) {tout} {doublons} >
<a href="#URL_ARTICLE">#TITRE</a>
</BOUCLE_display_non_excluded>

How does it work ?

-  In this loop, all the job is handled by the criteria doublons. The first loop (BOUCLE_exclude) selects from among all the ARTICLES those which are tagged with keyword “excluded” (titre_mot=excluded

-  The second loop (BOUCLE_display_non_excluded) displays all (tout) ARTICLES, except those which have already been selected by the previous loop, also coded with a (doublons) criteria.

-  One can easily replace ARTICLES with RUBRIQUES, BREVES or SITES depending on which items are requested. When so doing, just adapt the content of “href” destination (#URL_RUBRIQUE, #URL_BREVE et #URL_SITE).

-  The keyword used in this example is ’excluded’. You can easily replace it by another one you choose. Make sure not to have 2 or more keywords with the same name (’titre’) in 2 or more different keyword groups, unless of course you are intending to exclude them all.

P.S.

Originally posted by Olivier GENDRIN. Translated from French by Etienne B. ( loiseau2nuit [AT] no-log.org )

Back to top

Comment on this article

Who are you?
  • [Log in]

To show your avatar with your message, register it first on gravatar.com (free et painless) and don't forget to indicate your Email addresse here.

Enter your comment here Les choses à faire avant de poser une question (Prolégomènes aux rapports de bugs. )
Add a document

Back to top

Here they're talking

  • (fr) Zpip-dist en HTML5

    15 juin 2010 – 10 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Une surcharge des squelettes Zpip-dist qui tire parti des nouvelles balises offertes par la spécification HTML5. Attention, ce plugin n’est plus compatible avec les nouvelles versions de Zpip, qui a connu plusieurs incompatibilités de nomenclature (...)

  • (fr) Une licence pour un article

    18 avril 2007 – 25 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Sur une idée originale de erational, voici un plugin permettant de lier une licence à un article.

  • (fr) Plugin Parrainage

    6 novembre 2011 – <blink style='color:red;'>public|spip|ecrire:commentaire</blink>

    Permettre aux utilisateurs d’inviter leurs contacts à s’inscrire sur le site. Description Vous connaissez le web moderne et son cortège d’applis toujours en version « beta » et de buzz sur le dernier réseau à la mode ? Vous voulez vous aussi vous y (...)

  • (fr) Formulaire de contact libre

    27 avril 2011 – 36 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Dans SPIP il n’y a pas un formulaire de contact, mais autant de formulaires de contact que d’auteurs. Cette phrase de Romy, dans son article Une page de contact dans mon SPIP, pointe un petit manque de SPIP. La possibilité d’insérer rapidement un (...)

  • (fr) Plugin Mot de Passe Compliqué

    2 novembre 2007 – 16 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Ce plugin ajoute un testeur de complexité de mot de passes dans les formulaires de choix de mot de passe de SPIP.