I'm showing entries on a page. Depending on the value of the field postAspectRatio
, I would like the layout of this shown entry to change just slightly and thus requiring it's own unique markup.
I've tried to do this using what I know about twig IF syntax but it's not working.
Any help?
{% block content %}
{% for entry in craft.entries.section('projects').order('postDate asc').limit(500).find() %}
{% if entry.postAspectRatio == 'Portrait' %}
<div class="title portrait">
<a href="{{ entry.url }}">
<p><span>{{ entry.studio }}</span>{{ entry.title }}</p>
</a>
</div>
{% endif %}
{% if entry.postAspectRatio == 'Landscape' %}
<div class="title landscape">
<a href="{{ entry.url }}">
<p><span>{{ entry.studio }}</span>{{ entry.title }}</p>
</a>
</div>
{% endif %}
{% endfor %}
{% endblock %}
postAspectRatio
?{{ entry.postAspectRatio }}
.