Fork me on GitHub

default

An article by Gaspard Bucher

Set default parameters.

Set default parameters.

This method lets you set default parameters for sub elements such as date formatting options, disabling html escape, labels, etc.

In the following example, all attributes are shown with a translated label:

<ul do='default' label='t' blank='hide'>
  <li do='show' attr='title'/>
  <li do='show' attr='surname'/>
</ul>

In french, this would produce:

<ul>
  <li><label>titre</label> <span>La vie en rose</span></li>
  <!-- no surname, element removed -->
</ul>

Add host to links

This is useful in rss feeds or exports for example.

<r:default host='#{site.host}'><r:link/></r:default>