Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T03:11:38.323Z
Answers.Text: What if I added 2 or more assets in one entry..
Answers.UserDisplayName: D.M. Vamsi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T03:13:03.810Z
Answers.Text: 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.
Answers.UserDisplayName: Aaron Berkowitz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T03:15:04.927Z
Answers.Text: I done like this '<ul class="tools-list">
           
                              <li> <a href="#">{% set image = entry.mojorServicesIcons[2] %}
  <img src='{{image.getUrl()}}' /></a></li>
                             </ul>'
Answers.UserDisplayName: D.M. Vamsi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T03:15:16.610Z
Answers.Text: Images are not displaying
Answers.UserDisplayName: D.M. Vamsi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T03:15:35.860Z
Answers.Text: In the same filed I added 2 assets..
Answers.UserDisplayName: D.M. Vamsi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T03:19:37.510Z
Answers.Text: 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>.
Answers.UserDisplayName: Aaron Berkowitz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-12T02:36:12.737Z
Answers.LastActivityDate: 2015-06-12T02:36:12.737Z
Answers.UserDisplayName: Aaron Berkowitz
Body: <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>
  
Tags: <templating><assets>
Title: Displaying Image Assets to Home Entries
ThreadText: # 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() %}
  <img src='{{image.getUrl()}}' />
  
  ```
  
  Or, if you want a specific image:
  
  ```
  {% set image = entry.myImageFieldHandle[3] %}
  <img src='{{image.getUrl()}}' />
  
  ```
  
  > **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>.  
  
  ---
  
  