Announcement

Collapse
No announcement yet.

PDF template engine : add handlebars helper

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

  • wondertrout
    replied
    Had searched for hours before coming across this thread. Works perfectly!

    Leave a comment:


  • rinorway
    replied
    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, 09:18 AM. Reason: formatting

    Leave a comment:


  • rinorway
    started a topic PDF template engine : add handlebars helper

    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, 09:19 AM.
Working...
X