<p>When you are working with an asset field you are actually looking at the object so you need to call <code>{{asset.url}}</code> in order to actually output the path to the image or whatever asset you are working with.</p>

<pre><code>{% for asset in entry.projectBanner %}

    &lt;img src="{{asset.url}}&gt;

{% endfor %}
</code></pre>

<p>As some additional information I would checkout eager-loading in craft as it can drastically help performance as your website grows!</p>

<p><a href="https://craftcms.com/docs/templating/eager-loading-elements">https://craftcms.com/docs/templating/eager-loading-elements</a></p>

CC BY-SA 3.0
2016-05-02T13:54:48.013Z
2016-05-02T13:54:48.013Z
mcclaskiem
<p>I am new to Craft CMS. I am building my first industrial design portfolio site and am facing a brick wall.. The problem is that I have three image handlers that I set up in field. <code>thumbnail</code>, <code>projectBanner</code> and <code>projectThumbnail</code> that I want to display in project section. I found this code snippet and made changes to it to match one of my image handler.</p>

<pre><code>{% for asset in entry.projectBanner %}
    &lt;img src="{{ asset.getUrl(thumb) }}" alt="{{ asset.title }}" /&gt;
{% endfor %}
</code></pre>

<p>I made sure that I have upload the image (projectBanner) to a entry and refreshed the browser. The image does not show up but the title does. Could anyone please tell me what I did wrong and what the correct method to achieve outputting images into entries?</p>

CC BY-SA 3.0
2016-05-02T23:10:38.173Z
@mcclaskiem: While related, I don't believe the thread is a duplicate. The OP may benefit greatly from reading the linked thread, however.
Lindsey D
CC BY-SA 3.0
2016-05-02T23:11:28.597Z
@WilliamSpark: What is the value of `thumb`? Are you certain it's outputting a string containing one of the image transform handles you specified?
Lindsey D
CC BY-SA 3.0
2016-05-02T23:51:26.203Z
@LindseyD ya that makes sense thats why I answered it and marked duplicate. Based on the question, it seems as though they are separate fields, could be wrong though.
mcclaskiem
<templating><assets><image>
Output image in template
# Output image in template

(Asked by: username_0 on 2016-05-02)

I am new to Craft CMS. I am building my first industrial design portfolio site and am facing a brick wall.. The problem is that I have three image handlers that I set up in field. thumbnail, projectBanner and projectThumbnail that I want to display in project section. I found this code snippet and made changes to it to match one of my image handler.
{% for asset in entry.projectBanner %}
    
{% endfor %}

I made sure that I have upload the image (projectBanner) to a entry and refreshed the browser. The image does not show up but the title does. Could anyone please tell me what I did wrong and what the correct method to achieve outputting images into entries?

**Tags:** templating, assets, image
> **Comments:**
> **username_1**: @mcclaskiem: While related, I don't believe the thread is a duplicate. The OP may benefit greatly from reading the linked thread, however.  
> **username_1**: @WilliamSpark: What is the value of `thumb`? Are you certain it's outputting a string containing one of the image transform handles you specified?  
> **username_2**: @LindseyD ya that makes sense thats why I answered it and marked duplicate. Based on the question, it seems as though they are separate fields, could be wrong though.  

---

## 1 answers

### Answer by username_2 on 2016-05-02. Score: 7

When you are working with an asset field you are actually looking at the object so you need to call {{asset.url}} in order to actually output the path to the image or whatever asset you are working with.
{% for asset in entry.projectBanner %}

    https://craftcms.com/docs/templating/eager-loading-elements


---

