|wrap

The |wrap{<tag>} filter wraps the tag to which it is applied with the HTML tag specified as a parameter.

Simple examples

[(#BALISE|wrap{<b>})]

will display as HTML source:
<b>blah blah</b>

[(#TITRE|wrap{#TOTAL_BOUCLE|=={1}|?{<h1>, <h2>}})]

will display as HTML source if the loop returns only one result:
<h1>The Title</h1>
but will display:
<h2>The Title</h2><h2>Another Title</h2>
if the loop returns several results.

HTML tag sequences

It is also possible to pass a series of tags as arguments. The final tags will be calculated to produce a correct nesting. The tags specified as filter arguments may include attributes.

Example :

[(#BALISE|wrap{<div><span class="thing"><b>})]

will display as HTML source:
<div><span class="thing"><b>blah blah</b></span></div>

Author jack Published :

Translations : English, français, Nederlands, Português