The syntax for an Output markup (which may resolve to text) is {{ OutputMarkupExpression }}. The Output markup expression is a string that instructs the template engine how process this part of the text template.
Output markup expressions can consist of markup variables, string or integer literals and filters. String literals are put in single quotes.
When the text template is rendered the whole markup string (including the braces) will be replaced by the text generated by the template engine. If a markup expression cannot be parsed by the template engine the markup will be replaced with an empty string or by an error message.
Table one shows some examples for output markup expressions.
Text Template |
Notes |
Hello {{FirstName}} |
This template uses a markup with expression FirstName. This expression will be treated as variable by the template engine. If the context in which the template is executed provides a value for a the variable FirstName the markup will be replaced with this value. |
Hello {{user.name}} |
This template uses a markup with expression name user.name. This expression refers to an object with name user and a property of that object called name. If the context in which the template is executed provides an object with name user and if that object has a property name the markup will be replaced with the value of that property. |
Hello {{ 'SomeName' }} |
The '' in the markup expression advice the engine to threat the expression as string. Therefore the result after rendering this markup would be Hello SomeName. |
Table 1: Simple examples for output markup expressions