Using directives together

You can use directives as many times on a page as you want, and you can nest directives similarly as you can nest HTML elements. For example, the following code will list the animals and print the name of large animals in a bigger font:

<p>We have these animals:
<table border=1>
  <tr><th>Name<th>Price
  <#list animals as being>
  <tr>
    <td>
      <#if being.size == "large"><font size="+1"></#if>
      ${being.name}
      <#if being.size == "large"></font></#if>
    <td>${being.price} Euros
  </#list>
</table>  

Note that RPL does not interpret text outside RPL tags, interpolations and comments. Therefore, it does not interpret the font tags in the example as badly nested ones.

Next steps

Handling missing variables

Learn more

Directive Reference

Most commonly used directives

Defining your own directives