SPIP - Contrib

[ar] [en] [es] [fr] [it]



Home page > Useful loops

Displaying items with a specific keyword

Monday 22 January 2007, by Loiseau2nuit. Latest addition Monday 22 January 2007

All the versions of this article:


This loop lets your site display items (section, article, news, ...) according to their attached keyword(s).


<BOUCLE_keyword (ARTICLES) {titre_mot=display} >
<a href="#URL_ARTICLE">#TITRE</a>
</BOUCLE_keyword>

How does it work?

- Spip.net’s documentation on keywords.

- One can easily replace ARTICLES with RUBRIQUES, BREVES or SITES depending on what you wish to display. If doing so, just adapt the content of "href" destination (#URL_RUBRIQUE, #URL_BREVE et #URL_SITE).

- The keyword used in this example is ’display’. You can easily replace it by another one of your choice. When so doing, make sure not to have two or more keywords with the same name (’titre’) in two or more different keyword groups, unless you are intending to include the items marked by all of them.

- If you liked this, you might read this article: Excluding items with a particular keyword

P.S.

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


Reply to this article



Follow-up of the site's activity RSS 2.0 | Site Map | Private area | Charte et vie SPIP-Contrib | SPIP | L'autre.net