I’m not sure where I’m going wrong with this. I have a loop that’s printing out a couple of email addresses. I want to set one as the “primary” address based on it’s status of primary or not. If I give the template {{ x.primary }} I get the values of True or False.
I’d like my output to look like:
- Work: bob@example.com (Primary)
- Personal: bob2@example.com
- Personal: bob3@example.com
<ul>
{% for x in member.person.email_addresses.all %}
{% if x.publish %}
<li> {{ x.type }}: {{ x.email }} {% if x.primary == "True" %} (Primary) {% endif %} </li>
{% endif %}
{% endfor %}
</ul>
Don’t quote
True. It’s justTrue:Or more simply: