Announcement

Collapse
No announcement yet.

PDF template engine : add handlebars helper

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF template engine : add handlebars helper

    Espo already extends handlebars with helpers :
    https://github.com/espocrm/espocrm/b...helper.js#L110
    but these are only available in views.

    Suggested is to make those available for email templates / pdf generation as well.

    It would enhance the template engine and allow for eg filtering, for example: print only orders for an account that have been paid:

    Code:
    <!-- {{#each items}}-->
    
    {{#ifEqual pay_status "paid"}}
    You paid on {{pay_date}}
    {{else}}
    You did not pay yet.
    {{/ifEqual}}
    etc
    Last edited by rinorway; 09-20-2022, 08:19 AM.

  • #2
    I have been testing and actually this works within PDF templates already :
    Code:
    <!-- {{#ifEqual messagetype "error"}} -->
    We have an ERROR on {{system}}
    <!-- {{/ifEqual}} -->
    Last edited by rinorway; 09-20-2022, 08:18 AM. Reason: formatting

    Comment


    • #3
      Had searched for hours before coming across this thread. Works perfectly!

      Comment

      Working...
      X