[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


The MOTS Loop (Keywords)

October 2003 — updated on : October 2010

All the versions of this article:

The MOTS loop returns a list of keywords.

The selection criteria

You should use one of the following criteria to indicate which keywords are selected.

-  {tout}, i.e. "all", selects all keywords from the whole site.

-  {id_mot} returns the keyword identified by the unique id_mot.

-  {id_groupe} returns the keywords associated with the keyword group numbered id_groupe. [SPIP 1.4]

-  {id_article} returns the keywords associated with this article (this is the most common use of this loop).

-  {id_rubrique} returns the keywords associated with this section. [SPIP 1.4]

-  {id_breve} returns the keywords associated with this news item. [SPIP 1.4]

-  {id_syndic} returns the keywords associated with a referenced site. [SPIP 1.4]

-  {id_forum} returns the keywords associated with a forum message. [SPIP 1.4]

-  {titre=france} returns the keyword named france (for example).

-  {type=country} returns the keywords from the keyword group named country (for example).

The display criteria

You can use any of the criteria applicable to all loops.

Tags for this loop

-  Tags retrieved from the database

The following tags correspond to attributes of the keywords retrieved directly from the database. You can generally use them as sorting criteria as well (for example {par titre} by title).

-  #ID_MOT returns the unique identifier of this keyword.

-  #TITRE returns the title (the keyword itself).

-  #DESCRIPTIF returns the description of the keyword.

-  #TEXTE returns the text associated with the keyword.

-  #TYPE returns the name of the keyword group to which this keyword belongs (for example, the keyword "France" could be associated with the keyword group named "Country").

-  #LOGO_MOT [SPIP 1.4] returns the logo associated with this keyword. (N.B. since SPIP 2.1, there has been a new syntax for passing arguments to #LOGO_XX style tags)

-  #URL_MOT gives the address (URL) of the page dedicated to this keyword.

The GROUPES_MOTS Loop (Keyword Groups)

The GROUPES_MOTS loop [SPIP 1.5] is of a marginal use but deserves to be quoted here. If you have several keyword groups, the loop makes it possible to select these groups and to organize, for example, a summary page of all the keywords classified alphabetically by group with the following code:

The tags and criteria associated with this loop are:
-  #ID_GROUPE, the identifier of the keyword group (also available in the MOTS loop);
-  #TITRE, the name of the group (inside the MOTS loop you can use #TYPE to display this value).

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