Reply To: empty field in database not handled as expected


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)}
   <td nowrap class="">{$customFieldLabels.invoice_cf1|htmlSafe}:</td>
   <td class="si_right" colspan="3">{$invoice.custom_field1|htmlSafe}</td>