Answers.Body: <p>You need to loop through the assets as follows:</p>
  
  <pre><code>{% for asset in block.memberPhoto %}
      &lt;img src="{{ asset.url }}" alt="{{ block.memberName }}" /&gt;
  {% endfor %}
  </code></pre>
  
  <p>See <a href="https://craftcms.com/docs/assets-fields" rel="nofollow">https://craftcms.com/docs/assets-fields</a> for more info.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T19:09:09.760Z
Answers.Text: Instead of a loop it's way better for your page performance to use the `first` method to get the first asset. Only use a loop if there's multiple images.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T19:10:24.050Z
Answers.Text: Also see http://craftcms.stackexchange.com/questions/13401/impossible-to-invoke-a-method-on-a-null-variable
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T19:36:47.150Z
Answers.Text: Ok great, Either one works. So I guess I will go with the first method for performance because there is only one photo per profile. Thanks!
Answers.UserDisplayName: Matthew Carleton
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-27T18:44:14.607Z
Answers.LastActivityDate: 2016-01-27T18:44:14.607Z
Answers.UserDisplayName: Ben Shoults
Body: <p>First time working with Craft. I've got a Matrix field for team member profiles, title, name, image, etc.</p>
  
  <p>I've got all the info pulled into the page but can't get the image. Here is my code, any help is appreciated!</p>
  
  <pre><code>{% for block in entry.teamMember %} 
      &lt;figure class="team-item"&gt;
          &lt;img src="{{ memberPhoto.url }}" alt="{{ block.memberName }}" /&gt;
  
          &lt;figcaption class="team-item--info"&gt;
              &lt;h3&gt;{{ block.memberName }}&lt;/h3&gt;
              &lt;h4&gt;{{ block.memberTitle }}&lt;/h4&gt;
              &lt;h5&gt;hometown: {{ block.memberLocation }}&lt;/h5&gt;
          &lt;/figcaption&gt;
      &lt;/figure&gt;
  {% endfor %}
  </code></pre>
  
Tags: <templating><assets><matrix>
Title: Images in Matrix field
ThreadText: # Images in Matrix field
  
  (Asked by: username_0 on 2016-01-27)
  
  First time working with Craft. I've got a Matrix field for team member profiles, title, name, image, etc.
  
  I've got all the info pulled into the page but can't get the image. Here is my code, any help is appreciated!
  
  ```
  {% for block in entry.teamMember %} 
      <figure class="team-item">
          <img src="{{ memberPhoto.url }}" alt="{{ block.memberName }}" />
  
          <figcaption class="team-item--info">
              <h3>{{ block.memberName }}</h3>
              <h4>{{ block.memberTitle }}</h4>
              <h5>hometown: {{ block.memberLocation }}</h5>
          </figcaption>
      </figure>
  {% endfor %}
  
  ```
  
  **Tags:** templating, assets, matrix
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-01-27. Score: 2 | Accepted answer
  
  You need to loop through the assets as follows:
  
  ```
  {% for asset in block.memberPhoto %}
      <img src="{{ asset.url }}" alt="{{ block.memberName }}" />
  {% endfor %}
  
  ```
  
  See <https://craftcms.com/docs/assets-fields> for more info.
  
  > **Comments:**
  > **username_2**: Instead of a loop it's way better for your page performance to use the `first` method to get the first asset. Only use a loop if there's multiple images.  
  > **username_2**: Also see http://craftcms.stackexchange.com/questions/13401/impossible-to-invoke-a-method-on-a-null-variable  
  > **username_0**: Ok great, Either one works. So I guess I will go with the first method for performance because there is only one photo per profile. Thanks!  
  
  ---
  
  