<p>Have you tried something like this?</p>

<pre><code>{% set image = entry.myImageFieldHandle.first() %}
&lt;img src='{{image.getUrl()}}' /&gt;
</code></pre>

<p>Or, if you want a specific image:</p>

<pre><code>{% set image = entry.myImageFieldHandle[3] %}
&lt;img src='{{image.getUrl()}}' /&gt;
</code></pre>

CC BY-SA 3.0
2015-06-12T03:11:38.323Z
What if I added 2 or more assets in one entry..
D.M. Vamsi
CC BY-SA 3.0
2015-06-12T03:13:03.810Z
In the same field or separate fields? If in the same field you can use the second code snippet above to get the specific image you need by passing in an index.
Aaron Berkowitz
CC BY-SA 3.0
2015-06-12T03:15:04.927Z
I done like this '<ul class="tools-list">
         
                            <li> <a href="#">{% set image = entry.mojorServicesIcons[2] %}
<img src='{{image.getUrl()}}' /></a></li>
                           </ul>'
D.M. Vamsi
CC BY-SA 3.0
2015-06-12T03:15:16.610Z
Images are not displaying
D.M. Vamsi
CC BY-SA 3.0
2015-06-12T03:15:35.860Z
In the same filed I added 2 assets..
D.M. Vamsi
CC BY-SA 3.0
2015-06-12T03:19:37.510Z
Remember that arrays are 0 indexed, so be sure to do majorServicesIcons[0] and majorServicesIcons[1]. Alternatively, you can do a for loop inside your <ul>.
Aaron Berkowitz
CC BY-SA 3.0
2015-06-12T02:36:12.737Z
2015-06-12T02:36:12.737Z
Aaron Berkowitz
<p>I am trying to display the assets on entries. </p>

<ol>
<li>I created the assets group.</li>
<li>Uploaded the bunch of images to that group.</li>
<li>Added assets to the entries. </li>
</ol>

<p>Now I didn't understood how to write a code in templates/index.html to display those images. </p>

<p>Right now I want to understood how to display one image. </p>

<p>Thanks</p>

<templating><assets>
Displaying Image Assets to Home Entries
# Displaying Image Assets to Home Entries

(Asked by: username_0 on 2015-06-12)

I am trying to display the assets on entries.

1. I created the assets group.
2. Uploaded the bunch of images to that group.
3. Added assets to the entries.

Now I didn't understood how to write a code in templates/index.html to display those images.

Right now I want to understood how to display one image.

Thanks

**Tags:** templating, assets


---

## 1 answers

### Answer by username_1 on 2015-06-12. Score: 4 | Accepted answer

Have you tried something like this?
{% set image = entry.myImageFieldHandle.first() %}


Or, if you want a specific image:
{% set image = entry.myImageFieldHandle[3] %}

> **Comments:**
> **username_0**: What if I added 2 or more assets in one entry..  
> **username_1**: In the same field or separate fields? If in the same field you can use the second code snippet above to get the specific image you need by passing in an index.  
> **username_0**: I done like this '<ul class="tools-list">                                       <li> <a href="#">{% set image = entry.mojorServicesIcons[2] %} <img src='{{image.getUrl()}}' /></a></li>                            </ul>'  
> **username_0**: Images are not displaying  
> **username_0**: In the same filed I added 2 assets..  
> **username_1**: Remember that arrays are 0 indexed, so be sure to do majorServicesIcons[0] and majorServicesIcons[1]. Alternatively, you can do a for loop inside your <ul>.  

---

