Skip to content

Instantly share code, notes, and snippets.

@richardsongo
Last active August 29, 2015 14:21
Show Gist options
  • Save richardsongo/6ee1de84033f54c9ba3d to your computer and use it in GitHub Desktop.
Save richardsongo/6ee1de84033f54c9ba3d to your computer and use it in GitHub Desktop.
Conditional statement if an entries relation field is empty?
{% if entry.fieldHandle |length %}
{{ entry.fieldHandle}}
{% else %}
{{ global.fieldHandle}}
{% endif %}
How can I conditionally display content if its a specific section?
{% if entry.section.handle == 'lettings' %}
{{ entry.rentFrequency.label }}
{% endif %}
Conditional dependent on the length of a field within a matrix field:
{% if block.destination | length > 25 %}<br />{% endif %} {{ block.smallCost }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment