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

Denna sida publicerades: 2013-10-11

Skriv ut PDF-avsnitt

Hjälpte informationen på den här sidan dig?

Missa inga nya rön, tips och tricks! Prenumerera på insite!

Find us!

SiteVision AB (Headquarter)
Vasagatan 10
702 10 Orebro
Sweden

Info: +46 19-17 30 30
Support: +46 19-17 30 39

Latest Tweets