SimpleInvoices Group Forum › Forums › Fearless359 SimpleInvoices Discussion Group › empty field in database not handled as expected › Reply To: empty field in database not handled as expected
April 26, 2021 at 7:27 am
#1549
RRowley
Participant
The isset()
test for a field is to see if there is valid content to print. You can use the empty()
test on a field to determine if both the label and the field should be printed. For instance here is a test to determine if custom field 1 should be printed:
<!-- Show the Invoice Custom Fields if valid -->
{if !empty($customFieldLabels.invoice_cf1) && isset($invoice.custom_field1)}
<tr>
<td nowrap class="">{$customFieldLabels.invoice_cf1|htmlSafe}:</td>
<td class="si_right" colspan="3">{$invoice.custom_field1|htmlSafe}</td>
</tr>
{/if}
Recent Comments