Translations
Also known as contents, translations is a convenient way how to make applications multi-lingual. Upon opening an application, the full contents object is loaded and used for all textual content visible to the customer.
Available variables
The following variables are available in all content strings (starting from FW v5.13.0):
input- all collected (and defaulted, prefilled) customer inputflags- custom booleans set by the frameworkquote- all data returned by thequoterequestpolicy- all data returned by thepolicyrequestclaim- all data returned by theclaimrequest (FNOL mode)lead- lead data includingfirst_name,last_name,email, andquoteasset.{ref}- all the asset URLs available on the item leveldocument.{request}.{ref}.{"url"|"name"}- all the dynamic documents generated by requestroute- name of the currently active screen and route paramsdataset.{field_name}.{property}- loaded dataset item data (see dataset section below)query_string- all data from query stringactive_policy- active policy data (used in FNOL mode)renewal- policy renewal dataform- form state (e.g.,form.has_errors)context- repeater context (e.g.,context.repeater_index,context.repeater_index_human)
Hardcoded Fields
Some fields are "hardcoded" and exist at the root level of input, not under input.data:
first_name- Customer first namelast_name- Customer last nameemail- Customer email
Reference these WITHOUT the data. prefix:
All other customer-created fields should use the data. prefix:
Dataset Variables
When a field has the in_dataset validation rule and a value is selected, the dataset item is loaded and accessible via dataset.{field_name}.
Structure:
Usage:
Where {field_name} is the form field containing the dataset item ID, and {property} is any field from the dataset item.
Examples:
Usage Examples
Available transformers
Not always data is collected from the customers in exactly the same way as displayed back to the customer. For example, when monetary values are collected, they are converted to values in cents (1 Eur = 100). When displaying this value back to the customer, the value needs to be converted back to the original (100 = 1 Eur). This and more is achieved with transformers.
asCurrency
When monetary values are collected they are stored as value in cents (1 Eur = 100). In order to display these values in a human-readable way, the asCurrency filter needs to be used. By default the global price format is used.
The price format can also be overwritten locally by providing it as arguments:
For a more detailed explanation see the price format guide.
date
Sometimes the date value collected from the customer needs to be transformed before displaying via content strings. This can be achieved with date transformer.
By default is uses the globally defined date format (or if it's not set, then the default one in the KASKO framework).
Custom format can also be configured by passing in an additional argument.
For full information about the available formats, see the date format guide.
asNumber
When you need to format numeric values with specific decimal places and separators, use the asNumber transformer.
Custom format can also be configured by providing it as arguments (similar to asCurrency):
The format follows the pattern: (minIntegerDigits.minFractionDigits-maxFractionDigits, 'decimalSeparator', 'thousandsSeparator')
Last updated