The selection criteria
We will use one of the following criteria to indicate how we will select the elements:
- {tout}
, i.e. “all”, will select all the news items available on the site.
- {id_breve}
returns the news item identified by id_breve
. Since the identifier of each news item is unique, this criterion will return one or zero records.
- {id_rubrique}
returns all the news items available in the current section (rubrique), where “current” refers to the contextual environment of any surrounding loops.
- {id_mot}
returns all the news items linked to the current keyword (inside a MOTS loop, for instance).
- {id_mot}
returns all the news items linked to the current keyword (inside a MOTS loop, for instance).
- {titre_mot=xxxx}
, or {type_mot=yyyy}
returns the news items linked to the keyword named “xxxx” or the keyword group named “yyyy”. Warning, you cannot use the criteria {titre_mot=xxxx}
or{type_mot=yyyy}
several times in the same loop.
- {id_groupe=zzzz}
returns the news items linked to a given keyword group; it is the same technique {type_mot}
, but since we’re working with an identifier (a group number ), the syntax will be “cleaner”.
- {lang}
selects the news items in the language requested in the page’s address.
- {recherche}
i.e. search, returns the news items matching the words entered in the search interface (search engine incorporated into SPIP).
Tags for this loop
- Tags retrieved from the database
The following tags represent the items retrieved from the database (as opposed to those that are “calculated” and are explained later). You can also use them as sorting criterion (usually: {par titre}
, i.e. by title).
- #ID_BREVE
returns the unique identifier of the news item.
- #TITRE
returns the title of the news item.
- #DATE
returns the publishing date of the news item.
- #TEXTE
returns the text of the news item.
- #NOM_SITE
returns the name of the site given as the reference for the news.
- #URL_SITE
returns the URL of the site given as the reference for the news item.
- #ID_RUBRIQUE
returns the unique identifier of the section (rubrique) in which this news item is located.
- #LANG
returns the language of the news item. By default, this is the language of the sector in which the news item has been published.
- Tags calculated by SPIP
The following elements are calculated by SPIP. (They cannot be used as sorting criterion.)
- #NOTES
returns the footnotes (calculated from the analysis of the text).
- #INTRODUCTION
the first 600 characters of the text, where the typographical embellishments (bold, italic, ...) are removed.
- #URL_BREVE
is the complete URL of the news item’s page.
- #FORMULAIRE_FORUM
creates and displays the forum interface of the news item.
- #PARAMETRES_FORUM
creates the list of variables used by the form interface to post on the forum of the news item. For instance:
[<a href="spip.php?page=forum&(#PARAMETRES_FORUM)">Reply to this news item</a>]
It is possible to pass this tag a parameter specifying the return address to link to after having posted the new message to the forums. For example: <a href="spip.php?page=forum&(#PARAMETRES_FORUM{#SELF})">Reply to this news item</a>
will return the visitor to the same current page once the message has been validated.
- The logo
- #LOGO_BREVE
displays the logo of the news item and the hovering logo if it is applicable.
The logo is inserted thus:
- #LOGO_BREVE_RUBRIQUE
displays the logo of the news item, if it exists; if there is no logo, SPIP displays the logo of the section (rubrique).
No discussion
Add a comment
Avant de faire part d’un problème sur un plugin X, merci de lire ce qui suit :
Merci d’avance pour les personnes qui vous aideront !
Par ailleurs, n’oubliez pas que les contributeurs et contributrices ont une vie en dehors de SPIP.
Follow the comments:
|
