Enhanced iterator (PDF template)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ste1011
    Junior Member
    • May 2025
    • 20

    #1

    Enhanced iterator (PDF template)

    An iteration has only {{@index}} as counter.

    It would be great to have more information like cycle, isFirst, isLast, isEven, isOdd
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 10107

    #2
    In PDF templates, all are already supported.

    Code:
    {{#each contacts}}
      <div>
        {{#if @first}}Is First{{/if}}
        {{#if @last}}Is Last{{/if}}
        {{#ifMultipleOf @key 2}}Is Even{{else}}Is Odd{{/ifMultipleOf}}
        {{name}}
      </div>
    {{/each}}​

    Comment

    • ste1011
      Junior Member
      • May 2025
      • 20

      #3
      Thank you for this information.

      Would it be possible to add a @cycle that starts with '1' as @index starts with '0'?

      Comment

      Working...