SiteVision Onlinehelp
Search

Value rendering

Value rendering (HTML)


When these scripts are enabled is it possible to create a custom JavaScript and Velocity template that is used when rendering values. Value rendering is typically used when an administrator are viewing submitted forms values. An example of where this is used is in the "Questions form" portlet.

If custom value rendering is disabled the standard field value rendering will be used.

##
## Utilites and misc properties
#set ($propertyUtil = $sitevisionUtils.getPropertyUtil())
#set ($endecUtil = $sitevisionUtils.getEndecUtil())
#set ($textFont = $propertyUtil.getNestedString($portlet, 'textFont', 'selectorText'))
#set ($givenNameRef = $portlet.getNode("Form/Personal information/Given name"))

##
## Render question
#set ($question = $propertyUtil.getString($givenNameRef,"question",""))
<span class="$textFont">$question</span>
<br />

##
## Render value (if any) avoiding XSS problems
#if ($values.containsKey($givenNameRef))
   #set ($value = $values.get($givenNameRef))
   <span class="$textFont">$endecUtil.escapeXML($value)</span>
   <br />
#end

Value rendering (Email)


When these scripts are enabled is it possible to create a custom JavaScript and Velocity template that is used when creating the email message containing field values that can be sent to administrators. An example of where this is used are in the "Form" and "Questions form" portlets.

##
## Utilites and misc properties
#set ($propertyUtil = $sitevisionUtils.getPropertyUtil())
#set ($endecUtil = $sitevisionUtils.getEndecUtil())
#set ($textFont = $propertyUtil.getNestedString($portlet, 'textFont', 'selectorText'))
#set ($givenNameRef = $portlet.getNode("Form/Personal information/Given name"))
#set ($question = $propertyUtil.getString($givenNameRef,"question",""))
$question
#if ($values.containsKey($givenNameRef))
#set ($value = $values.get($givenNameRef))
$value
#end

Last updated:

se-sto-pio-sv5-1.sitevision-cloud.net
18.118.193.123