Removing these empty fields can be done in one of three ways – here’s a typical example of removing empty lines from an address:
1. If the Pagination Module is installed, set the ‘Remove blank lines for empty fields’ pagination option on the text box (set this using the Pagination Rules panel).
2. Use conditional processing:
1 2 3 4 | [Name] [Address1]@@if {Address2} <> ''@@ [Address2]@@endif@@@@if {City} <> ''@@ [City]@@endif@@ |
This is basically saying ‘if address 2 is not empty, insert a new paragraph followed by the address 2 field’.
3. Use the field prefix field option. So, for example, go to the Field Options for the Address 2 field – in the prefix option, enter:
1 | ^p |
Field prefixes are only applied when the field is not empty, so there will only be a new paragraph if the field has content. In the product style, all fields could then be included on the same line and new paragraphs will be inserted where appropriate automatically:
1 | [Name][Address1][Address2][City][Tel] |
Note that with the first two options, the field specifiers will be removed from the document when empty. If the data changes later (so the field is no longer empty), the field cannot re-appear in the document.