Embedded expressions

Embedded expressions are template expressions that can be processed in all text-based elements (texts, comments, processing instructions, and so on), as well as in attribute values and processing instructions. The syntax is a shortcut that does not need any gwc instruction.

Syntax

{ template_expression }

Examples

Example:
<link
  href='{resourceuri("css_theme.css","SetHtml5")}'
  rel='stylesheet'
  type='text/css'
/>
Example:
<p>{
application/ui/topmostNormalWindow/form/staticLabel['label1']/text}</p>
Example:
<script type="text/javascript"> var gwc = {{
 initTime:new Date().getTime(), cfg:{{} } </script>
Note:
  1. To escape the embedded expression double the left curly brace: "{{"
  2. An expression evaluated to null results in an empty string.
  3. Inside an attribute value, if all expressions are evaluated to null and if no literal text appears between the expressions, the attribute is removed from the document.
  4. More than one expression may be embedded into a string. Each expression is evaluated and the result is converted into a string, as it is with the string function.
  5. Template instructions takes precedence over embedded expressions. It makes no sense to use the _tpl_ variable in the SBRE attributes instruction for an attribute whose value is also driven by an embedded expression
In this example, the "class" attribute will be empty.
<p class="{text}" gwc:attributes="class _tpl_" gwc:content="text"/>
In these examples, the displayed text is "has been overridden"
<input type="submit" value="{form/staticLabel['label1']/text}"
 gwc:attributes="value 'has been overriden'" />
<p gwc:content="'has been overriden'">{form/staticLabel['label1']/text}</p>