If statement based on company field

I’m tried to make sure that a certain banner is only shown if a company is still active. I feel like the code below should work, but instead it always shows the banner, even if a company is set to inactive. Would should I change to make this work?

{% if company.storestatus == ‘Active’ %}
<div style=“max-width: 80%;”><p>{{company.storestatus}}</p><a href=“{{company.storeurl}}”><left><img src=“{{company.storelogourl}}” alt=“Company Store Logo” width=“80%” height=“auto”></left></a>
</div>
{% endif %}

Hi @EvaUR,
the code looks

just to make sure:

  • The property is a dropdown/radio-buttons - not a checkbox?
  • The values are capitalized(first option in screenshot)

  • You’re previewing the page with a contact that has an (in)active status set in the CRM

If it’s a checkbox the code should look like this:

{% if company.storestatus == 'yes' %}
<div style="max-width: 80%;"><p>{{company.storestatus}}</p><a href="{{company.storeurl}}"><left><img src="{{company.storelogourl}}" alt="Company Store Logo" width="80%" height="auto"></left></a>
</div>
{% endif %}

If you’re using a dropdown/radio with lowercase values the code should look like this

{% if company.storestatus == 'active' %} {# or "inactive" #}
<div style="max-width: 80%;"><p>{{company.storestatus}}</p><a href="{{company.storeurl}}"><left><img src="{{company.storelogourl}}" alt="Company Store Logo" width="80%" height="auto"></left></a>
</div>
{% endif %}

The reason for the last one is: the page-builder will always display everything regardless of your if-statement(s)

best,

Anton