This loop returns a list of sections (rubriques).
Note. A RUBRIQUES loop only displays "active" sections, i.e. those containing published articles, attached documents (from [SPIP 1.4]), published sites or active sub-sections. In this way, you avoid empty sections which do not offer any navigation. Since SPIP 1.7.1, it is possible to force the display of empty sections (see below).
Selection Criteria
You should use one of the following criteria to indicate which sections are selected.
- {id_rubrique} returns the section identified by id_rubrique. As the identifier of each section is unique, this criterion will only ever return a single section or none.
- {id_secteur} returns a list of the sections from the sector identified by id_secteur. You can also, by extension, use the branche criterion described in the ARTICLES loop to return all sections from the section that is currently in context.
- {id_parent} returns a list of the sections contained in the section identified by id_parent.
- {racine} returns a list of the sectors in the root level (identical to {id_parent=0}).
- {id_enfant} returns the section which contains the section identifed by id_enfant (only one answer; or no answer if the section is located at the root of the site).
- {meme_parent} returns a list of the sections which have the same parent section as the current section. This makes it possible to display sections which are on the same level in the hierarchy.
- {recherche} returns the sections corresponding to the words indicated in the search interface of the built-in search engine. See the page devoted to the search engine.
Starting from version [SPIP 1.4], sections can be related to keywords. Keyword criteria can therefore be used in the (RUBRIQUES) loops:
- {id_mot}, {titre_mot=xxx} the sections related to the keyword identifed by id_mot or by its title which is titre_mot;
- {id_groupe}, {type_mot=yyyy} the sections related to keyword group identified by id_groupe or by its title which is type_mot.
- [SPIP 1.7.1] {tout} displays empty sections as well as sections containing published elements. However, this choice must be restricted to very specific needs; as a matter of fact, SPIP does not display, by default, sections not containing any active element, to garantee that the site will not contain “dead ends” (pages without any content).
- [SPIP 1.7.1] {lang} selects the sections in the language requested in the page’s address.
Display Criteria
Once you have specified the selection criteria, you will be able to add the following criteria to restrict the number of displayed elements.
- {exclus} makes it possible to exclude the current section from the result set (useful with meme_parent).
You can also use the criteria applicable to all loops.
Tags of this loop
- Tags retrieved from the database
The following tags represent the items retrieved from the database. You can also use them as sorting criterion (for example, {par titre} by title).
- #ID_RUBRIQUE returns the unique identifier of the section.
- #TITRE returns the section’s title
- #DESCRIPTIF returns the section’s description
- #TEXTE returns the section’s main text
- #ID_SECTEUR is the identifier of the sector on which the section depends (the sector being the section located at the root of the site).
- #ID_PARENT is the identifier of the parent section. If this section is located at the root of the site, it will return 0.
- #LANG returns the section’s language.
- Tags calculated by SPIP
The following elements are calculated by SPIP. They cannot be used as sorting criteria.
- #NOTES returns the footnotes (calculated from an analysis of the text).
- #INTRODUCTION returns the first 600 characters of the text. Styles such as Bold and Italic are removed.
- #URL_RUBRIQUE is the URL of the section’s page.
- [SPIP 1.4] #DATE displays the publication date of the most recent element
(articles, news...) published in the section and/or its sub-sections.
- #FORMULAIRE_FORUM creates the forum interface for this section.
- #PARAMETRES_FORUM returns a list of the variables needed to create a link to the forum making it possible to comment on this section in the forum. For example:
[<A HREF="forum.php3?(#PARAMETRES_FORUM)">Comment on this section</A>]
- #FORMULAIRE_SITE [SPIP 1.4] displays an interface making it possible for visitors to suggest links to referenced sites. These links will be held internally as "proposed" links until validated by an administrator.
This form is only displayed if you activated the option "Manage Web sites directory" in the Site Configuration area of the administrators panel, and if you set "Who can propose referenced sites?" to "visitors of the public site".
- Logos
- #LOGO_RUBRIQUE the section’s logo, including an optional hovering logo. If there is no logo for this section, SPIP will automatically search up the hierarchy and will display the first available logo.
The logo tags are formatted as follows:
[(#LOGO_RUBRIQUE|alignment|address)]
If you want to directly recover the logo’s filename, you should use the |fichier filter as follows:
[ (#LOGO_ARTICLE|fichier) ]
- [SPIP 1.4] #LOGO_RUBRIQUE_NORMAL displays the base logo; #LOGO_RUBRIQUE_SURVOL displays hovering logo: these two tags allow more control over the display of the two logos. For instance, when we are in a section, they allow us to manage a logo "with hovering" as a link to other sections and to leave a logo alone (without hovering) for the section we are in.
