Contents of parent loops

Sometimes it’s useful to retrieve contents from a loop which is a parent of the current loop, just by using an ordinary SPIP tag. SPIP offers a special syntax to do this explicitly with the # symbol, by simply identifying which loop you wish to retrieve the data from (where n below is the identifier of the targeted loop):

#_n:TAG

Example

Display the title of the section (rubrique) beside the title of the current article:

<BOUCLE_rubs(RUBRIQUES)>
  <ul>
    <BOUCLE_arts(ARTICLES){id_rubrique}>
      <li>#_rubs:TITRE - #TITRE</li>
    </BOUCLE_arts>
  </ul>
</BOUCLE_rubs>

Author Mark Baber Published : Updated : 12/03/23

Translations : English, Español, français