is it a custom one or an existing library? I am looking for conditional templating somehting like this {{#if something#}} <button> hello</button> {{#end#}}
where can I find the template engine guide?
Collapse
X
-
Hello,
for templates is used Handlebars
https://handlebarsjs.com/ on js, and additional helpers https://github.com/espocrm/espocrm/b...helper.js#L110
usage of `if` https://github.com/espocrm/espocrm/b.../date/list.tpl -
FYI, Handlebars does not support conditionals {{if x=="ok" then {{x}}
out of the box, you would need to register a helper.
Espo already does that already for views : https://github.com/espocrm/espocrm/b...helper.js#L110
What would be the preferred way to add that upgrade safe to pdf template handling?
Eg : Handlebars.registerHelper('ifEqual',....)
Instead of reinventing the wheel I would suggest to add minimal conditional helper to the core client.
more info : https://stackoverflow.com/a/9405113Comment
-
-
Comment