The HIERARCHIE (hierarchy) Loop

The HIERARCHIE loop returns a list of the SECTIONS which lead down from the root of the site to the current section or article.


Selection criteria

One of the following criteria must be used to select the results:

-  {id_article} returns the list of sections from the root down to and including the section which contains the article.

-  {id_rubrique} returns the list of sections from the root down to, but not including, the identified section.

Note: Since [SPIP 1.8], it has been possible to also obtain the identified section in the results by specifying the criterion {tout} (all).

These criteria — {id_article} and {id_rubrique} — cannot be used with a comparison. For example <BOUCLE_hi(HIERARCHIE) {id_article=12}> will give an error.

Warning: This loop must be placed within an outer ARTICLES or RUBRIQUES loop. It cannot “read” the id_article ou id_rubrique directly from the URL. (The same goes for HIERARCHIE loops in templates included using the <INCLURE{fond=xxx}> command or <INCLURE(xxx.php3)> for SPIP versions prior to 1.9).)

Display criteria

Since [SPIP 1.8], all the criteria of The RUBRIQUES Loop (Sections) may be used with this loop, including sort criteria. (So <BOUCLE_x(HIERARCHIE){id_article}{par hasard}> is possible, for example.)

Note: With versions of SPIP prior to 1.8, not all the "criteria applicable to all loops" applied to this loop. Only the criteria {"between"} and {a,b} could be used.

Tags of this loop

The HIERARCHIE loop returns section records. All the tags available in <TT>RUBRIQUES</TT> loops can therefore also be used here.

Note: There is no available criteria for id_breve (news items) within a HIERARCHIE loop, but when referring to a given news item, using the current id_article will still return the right section in question.

Author Paolo Published : Updated : 22/09/13

Translations : عربي, català, Deutsch, English, Español, français, italiano, Nederlands, русский, Türkçe, українська