The BREVES loop (news items)

The BREVES 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 :

-  {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).

Discussion

Aucune discussion

Ajouter un commentaire

Avant de faire part d’un problème sur un plugin X, merci de lire ce qui suit :

  • Désactiver tous les plugins que vous ne voulez pas tester afin de vous assurer que le bug vient bien du plugin X. Cela vous évitera d’écrire sur le forum d’une contribution qui n’est finalement pas en cause.
  • Cherchez et notez les numéros de version de tout ce qui est en place au moment du test :
    • version de SPIP, en bas de la partie privée
    • version du plugin testé et des éventuels plugins nécessités
    • version de PHP (exec=info en partie privée)
    • version de MySQL / SQLite
  • Si votre problème concerne la partie publique de votre site, donnez une URL où le bug est visible, pour que les gens puissent voir par eux-mêmes.
  • En cas de page blanche, merci d’activer l’affichage des erreurs, et d’indiquer ensuite l’erreur qui apparaît.

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.

Qui êtes-vous ?
[Se connecter]

Pour afficher votre trombine avec votre message, enregistrez-la d’abord sur gravatar.com (gratuit et indolore) et n’oubliez pas d’indiquer votre adresse e-mail ici.

Ajoutez votre commentaire ici

Ce champ accepte les raccourcis SPIP {{gras}} {italique} -*liste [texte->url] <quote> <code> et le code HTML <q> <del> <ins>. Pour créer des paragraphes, laissez simplement des lignes vides.

Ajouter un document

Suivre les commentaires : RSS 2.0 | Atom