Local Variables

The Luminate CMS template language supports setting local variables. Local variables can be created using the t:set command. Values can be static strings (for example, "This is a string") or dynamic values set using other template syntax functions.

<t:set id="myVar" value="'0'" /><t:set id="teaser" value="truncate(body,250)" />

You can use local variables to print values or test against other data.

<t:set id="lang" value="'en'"/>
<t:if test="header.accept_language == 'fr-CA'">
<t:set id="lang" value="'fr'"/> </t:if>
<script type="text/javascript">
window.location = '${lang}/index.html';
</script>

Note: Template tags are not interpolated within variable values.