SPIP

[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction

Download

The BREVES loop (news items)

September 2003 — updated on : October 2010

All the versions of this article:

The

loop, as its French name indicates, returns a list of news items.

<BOUCLEn(BREVES){criteria...}>


The selection criteria

We will use one of the following criteria to indicate how we will select the elements:

-  

, i.e. "all", will select all the news items available on the site.

-  

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.

-  

returns all the news items available in the current section (rubrique), where "current" refers to the contextual environment of any surrounding loops.

-  [SPIP 1.2]

returns all the news items linked to the current keyword (inside a MOTS loop, for instance).

-  {id_mot} (since SPIP 1.2) returns all the news items linked to the current keyword (inside a MOTS loop, for instance).

-  {titre_mot=xxxx}, or {type_mot=yyyy} (since SPIP 1.3) returns the news items linked to the keyword named "xxxx" or the keyword group named "yyyy". Warning, you cannot use the criteria

or

several times in the same loop.

-  {id_groupe=zzzz} (since SPIP 1.4 ) returns the news items linked to a given keyword group; it is the same technique

, 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.

-  

i.e. search, returns the news items matching the words entered in the search interface (search engine incorporated into SPIP). For more information, see the page on the search engine.

Display criteria

The criteria common to all loops apply here.

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. For more information, please refer to "Forms".

-  #PARAMETRES_FORUM creates the list of variables used by the form interface to post on the forum of the news item. For instance:

Since SPIP 1.8.2, it has been 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.

Historical note: In versions prior to SPIP 1.9, you had to write forum.php3? and not spip.php?page=forum&
Generally speaking, prior to SPIP 1.9, the URLs of pages generated by SPIP were of the form http://mysite.net/xxx.php3 and not http://mysite.net/spip.php?page=xxx.

-  The logo

-  

displays the logo of the news item and the hovering logo if it is applicable.

The logo is inserted thus:

.. where alignment is right, left or centre.

-  #LOGO_BREVE_RUBRIQUE (since SPIP 1.4 ) displays the logo of the news item, if it exists; if there is no logo, SPIP displays the logo of the section (rubrique).

Warning, since SPIP 2.1, there is a new syntax for passing arguments to the tags named #LOGO_XX.


Show the template of this page Site powered by SPIP | Translation area | Private area