Created
December 2, 2015 23:11
-
-
Save kmgdevelopment/dfe6d793fb7210bfc565 to your computer and use it in GitHub Desktop.
Craft: Single-Image Asset Field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set bannerBg %} | |
{% for bgImg in entry.bannerBg %} | |
{{ bgImg.url }} | |
{% endfor %} | |
{% endset %} |
You could use .first()
{% if entry.bannerBg %}
{% set banner = entry.bannerBg.first() %}
{% set bannerUrl = banner.url %}
{% endif %}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can just retrieve it using:
{{entry.bannerBg.first().url}}