Answer the question
In order to leave comments, you need to log in
How to remove empty lines created by Smarty?
Below is the part of the code which creates pdf with customer information. It works, but if some value (for example parish or state) is empty, then it creates empty row in the document.
1) First example
{sle n=c p=receiver/contact}
{foreach from=$c item=i name=contacts}
{gv c=$i p=person/name}
{gv c=$i p=organization/name}
{gv c=$i p=address/street} {gv c=$i p=address/house_nr} {gv c=$i p=address/appartment_nr}
{gv c=$i p=address/zip_code} {gv c=$i p=address/city}
{gv c=$i p=address/parish}
{gv c=$i p=address/state}
{if !$smarty.foreach.contacts.last}{/if}
{/foreach}
{if xpc(“gv“,“occupation“)}{gv p=occupation}{else}{/if}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question