Other Tips and Trickery

StringTemplate has a small handful of other commands, but the ones listed on the other pages of this article will give you a good head start. Included on this page, however, are some other noteworthy items.

Dynamic Template and Variable Calls

You can dynamically call variables and templates with the construct of
$variable_name.(dynamic_variablename)$. The same is true for templates: $(dynamic_variablename)()$. This comes in extremely handy when the name of the template isn't static, such as dynamically rendered forms, etc.

Escape Character for the $ delimiter.

\$, will evaluate to the literal dollar character, instead of starting a StringTemplate command.

Cheat Sheet

The String Template documentation has a good reference sheet for those who are already familiar with the product.

< Prev Next >