Tag syntax, the definitive version

Just like loops (boucles), tags often have optional components, and can sometimes also accept parameter arguments. Asterisks can be applied to bypass certain processes that are normally executed automatically for that tag.

#TAG
#TAG{argument}
#TAG{argument, argument, argument}
#TAG*
#TAG**
[(#TAG)]
[(#TAG{argument})]
[(#TAG*{argument})]
[ before (#TAG) after ]
[ before (#TAG{argument}|filter) after ]
[ before (#TAG{argument}|filter{argument}|filter) after ]
...

How the brackets work

The full syntax, with parentheses and square brackets, becomes mandatory as soon as one of the tag’s arguments also uses parentheses and square brackets, or when the tag contains a filter.

// risk of bad surprises:
#TAG{[(#TAG|filter)]}
// always correctly interpreted:
[(#TAG{[(#TAG|filter)]})]
// although this works in SPIP 2.0, results are not guaranteed:
#TAG{#TAG|filter}
// using a filter means you MUST also use parentheses and square brackets:
[(#TAG|filter)]

For details as to the meaning of the square brackets and parentheses, please refer to the article in the official SPIP documentation: SPIP tag syntax.

Example

Display a link to the home page:

<a href="#URL_SITE_SPIP">#NOM_SITE_SPIP</a>

Display an HTML <div> tag and the contents of the #SOUSTITRE (subtitle) field if it exists:

[<div class="subtitle">(#SOUSTITRE)</div>]

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

Translations : English, Español, français