Conditional PageBreaks in Docx
-
Is there an in-built Possibility to only do PageBreaks on certain conditions with the Docx Recipe or would I need to build my own Helper Method around this?
What I currently have is something that looks simplified like this:
{{#each objects}} {{template of object}} {{docxPageBreak}} {{/each}}
Since this at the End of the Report the last Page is just an empty Page which is not nice.
-
Try this:
{#each objects}} {{#if @last}}{{else}}{{docxPageBreak}}{{/if}}{{/each}