3

Is it possible to use an Asset field as a Global Set? For example:

{{ companyInfo.logo }}

1 Answer 1

4

If companyInfo if your global and logo if your Asset field, then you'd use it just like you would anywhere else keeping in mind that all relation fields (Assets, Users, Entries, Tags, Categories, etc.) always return a collection of results.

So, companyInfo.logo.first() will return the first asset and if you want to loop through them all:

{% for image in companyInfo.logo %}
    {{ image.getUrl() }}<br />        
{% endfor %}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.