Remove Blank Lines when Conditionally displaying fields

  • 2
  • Question
  • Updated 3 years ago
  • Answered
Is there a way to remove the blank lines when conditionally rendering fields?  Here is my template config:

{{OtherStreet}}
{{OtherCity}}{{#OtherCity}},{{/OtherCity}} {{OtherState}}  {{OtherPostalCode}}

{{#Fax}}Fax: {{/Fax}} {{Fax}}
{{#HomePhone}}Home Phone: {{/HomePhone}}{{HomePhone}}
{{#OtherPhone}}Other Phone: {{/OtherPhone}}{{OtherPhone}}
{{#AssistantName}}Assistant: {{/AssistantName}}{{AssistantName}}
{{#AssistantPhone}}Asst. Phone: {{/AssistantPhone}}{{AssistantPhone}}
Photo of Jay Steinberg

Jay Steinberg

  • 408 Points 250 badge 2x thumb

Posted 3 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Move the condition close statement outside the field name and carriage return for that particular field.   Something like this: 

{{#Fax}}Fax: {{Fax}}
{{/Fax}}{{#HomePhone}}Home Phone:{{HomePhone}}
{{/HomePhone}}{{#OtherPhone}}Other Phone: {{OtherPhone}}
{{/OtherPhone}}
Photo of Jay Steinberg

Jay Steinberg

  • 408 Points 250 badge 2x thumb
Works like a champ...thanks!