In the invoice template, I have at least 2 tables ...
# advancedpdf
l
In the invoice template, I have at least 2 tables for the items (items are shown in a table if it meets a specific set of criteria). Is there a way to not show the table if it’s blank anyway? I think it’s the ?has_content logic but not sure how to apply it to a table
d
Use the ?size list built-in. Like:
<#if itemlist?size gt 0>
(put the
<#list ...>
inside the if statement)
l
Thank you! I'll try this.
s
@Luis Whatever the differentiation is between the items, use that for the #if e.g. item.itemtype if invt items vs noninvt items
d
oh, I understand now! yeah, so using Dway's example, you can skip the
<#if>
and just filter directly in the
<#list>
. Like this:
<#list record.item?filter(item -> item?itemtype == 'inventory item') as item>
s
oh hey that's cool Thanks David