Yes, now it is possible! If you have a Closure Templates assembly that was cut in 2011 , you can declare local variables as follows:
{let $first: $person.firstName /} {$first}
Note that, like {param} , you can also define a local variable with a more complex expression between the opening and closing tags:
{let $name} {$person.firstName} {$person.lastName} {/let}
Sometimes you need to use this form if you want to use other commands to define your variable:
{let $className} {css name_class} {/let} <div class="{$name_class}"></div>
For more information on using let visit the project documentation.
bolinfest
source share