Question

Photo of Aaron Porter

0

Contribution Statement Lava Block: Second Address Line

Howdy folks!

I am not the greatest wizard of html, css, and lava, so this might be a silly fix.The second address line still appears even if there is no second address line value. It's not the biggest deal in the world, but I can't seem to figure out why.

line2.PNG

I've copied the code from the demo site and the second address line still appears. My theory is that it might be related to the image of our logo, but I wanted to ask you smart folks.

The code:

{% capture pageTitle %}{{ 'Global' | Attribute:'OrganizationName' }} | Contribution Statement{%endcapture%}
{{ pageTitle | SetPageTitle }}

<div class="row margin-b-xl">
<div class="col-md-6">
<div class="pull-left">
<img src="{{ 'Global' | Attribute:'PublicApplicationRoot' }}{{ 'Global' | Attribute:'EmailHeaderLogo' }}" width="100px" />
</div>

<div class="pull-left margin-l-md margin-t-sm">
<strong>{{ 'Global' | Attribute:'OrganizationName' }}</strong><br />
{{ 'Global' | Attribute:'OrganizationAddress' }}<br />
Federal Tax ID:
</div>
</div>
<div class="col-md-6 text-right">
<h4>Charitable Contributions for the Year {{ StatementStartDate | Date:'yyyy' }}</h4>
<p>{{ StatementStartDate | Date:'M/d/yyyy' }} - {{ StatementEndDate | Date:'M/d/yyyy' }}<p>
</div>
</div>

<h4>
{{ Salutation }} <br />
{{ StreetAddress1 }} <br />
{% if StreetAddress2 != '' %}
{{ StreetAddress2 }} <br />
{% endif %}
{{ City }}, {{ State }} {{ PostalCode }}
</h4>


<div class="clearfix">
<div class="pull-right">
<a href="#" class="btn btn-primary hidden-print" onClick="window.print();"><i class="fa fa-print"></i> Print Statement</a>
</div>
</div>

<hr />

<--- Trimmed Code --->

<p class="text-center">
Thank you for your continued support of the {{ 'Global' | Attribute:'OrganizationName' }}. If you have any questions about your statement,
email {{ 'Global' | Attribute:'DustinBusinessEmail' }} or call {{ 'Global' | Attribute:'OrganizationPhone' }}.
</p>

<p class="text-center">
<em>Unless otherwise noted, the only goods and services provided are intangible religious benefits.</em>
</p>

Thank you, and happy New Year!

  • Photo of Andy Pullen

    0

    In case someone down the road stumbles on this like I did, the solution for this issue is to change the line

    {% if StreetAddress2 != '' %}
    to
    {% if StreetAddress2 and StreetAddress2 != '' %}
    . The code from the demo site only evaluates to true if the field is blank, but most profiles' StreetAddress2 fields don't have any value, so the new code also checks for the "truthiness" of the field.