Render template

An element which renders one of the plugin’s templates in the form or document, used to include explanatory notes in forms.

Properties

type "render-template"
template Name of the plugin’s template
view (optional) Arbitrary data passed to template’s render() function

Use the inForm and inDocument common properties to control where the template is rendered.

Template rendering

The template is rendered with a view containing the properties:

view The view from the specification.
context The current context within the document (ie root of the document, current section, or element in repeating section).
externalData The external data that was set with the externalData() function on the FormInstance.

Example

The specification:

{
    "type": "render-template",
    "template": "forms/special-note",
    "inDocument": false,
    "view": {
        "text": "This is a note"
    }
}

will render the "forms/special-note" template in the editable form, but not when rendered as a document. The template might look like:

<div class="special-note">
  view.text
</div>