The Template component is a feature within Canvas that enables you to configure templates for apps (widgets). Canvas platform provides dynamic variables to avoid the repetition in writing codes when configuring templates. These dynamic variables can be reused with just a change in the input values.
The templates that can be configured in Canvas platform are as follows:
Column Template: It is a template for a particular column in a widget (grid).
For the column template the dynamic variable that is available is tplData. This variable is used to get the current cell value from the associated record.
A sample screen shot is shown here for reference:
The following code snippet is the Column Template configuration for the Beneficiary Details widget with the dynamic variable:Code Block language xml {{ #if tplData }} <input data-input = 'true' type = 'text' value = {{ tplData }} data-column-id = 'BENE_ID' data-single-click = 'true' > {{ /if }} <!-- tplData is the dynamic variable provided by Canvas for Column Template. --> <!-- BENE_ID is the Reference Number column's ID in the Beneficiary Details widget -->
- Row Template: It is a template for a row in a widget (grid) and applies to all the other rows in a widget.
- Full or View Template: It is a template for the full widget and can render dynamic data from the template.
- Static Template: The data is rendered as it is in the template in a static form.
...