|
From RA SIG meeting notes on 7/19: What would be ideal is if we could make it possible to add flow logic to templates via an extension on Mustache called Handlebars. This feature, along with
UXPROD-3199
Draft
, is a longer-term more sustainable path for tokens and templates. For example, instead of adding am effective name token defined as if preferred name, use that, if no preferred name, use first name. Another example would be if a field value is not empty, then print line with a label and field value; otherwise, leave empty and move to next line. This gives libraries infinitely more flexibility in how they define the text of their templates. It also requires no further development in terms of adding new tokens (
UXPROD-3199
Draft
) or singularly defined conditional tokens, such as preferred name.
Specific example for what this would like on a template:
{{#if (isdefined user.preferredName)}}
{{user.preferredName}}
{{else}}
{{user.firstName}}
{{/if}}
Questions
- For developers - are we already using Handlebars for looping? {{#loans}} {{loan.dueDate}} {{/loans}}.
|