Answers.Body: <p>It works very simply. Note that the photo field is an <strong>asset object</strong>, not an array of asset objects.</p>
  <pre><code>{% for user in block.staffList.all() %}
     Image URL: {{ user.photo.getUrl() }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-27T17:53:34.890Z
Answers.Text: That's the ticket, thanks! Just a quick note: to skip over people that don't have photos, you can use `{% if member.photo is not null %}`
Answers.UserDisplayName: Bryce
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-28T07:29:28.150Z
Answers.Text: @Bryce Of course, you can still do eager loading and caching 
  **{% for user in block.staffList.with(['photo']).all() %}** . I gave a short answer, Craft CMS has many methods to optimize.
Answers.UserDisplayName: Pavel Pavlovich
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-26T16:15:34.343Z
Answers.LastActivityDate: 2020-09-26T16:15:34.343Z
Answers.UserDisplayName: Pavel Pavlovich
Body: <p>I'm making a staff page with a User field type, so you select all the users you want displayed. I'm having trouble showing each user's photo though. This works:</p>
  <pre><code>{% for user in block.staffList.all() %}
     Image URL: {{ craft.assets.id(user.photoId).one().url }}
  {% endfor %}
  </code></pre>
  <p>But seems far from the ideal solution. Is there a more graceful way to do this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-25T20:54:17.413Z
Comments.Text: Ok, this works: `{{ user.photoUrl(user.id) }}`, but still seems a little redundant
Comments.UserDisplayName: Bryce
Tags: <users>
Title: Display user photo within a User field type
ThreadText: # Display user photo within a User field type
  
  (Asked by: username_0 on 2020-09-25)
  
  I'm making a staff page with a User field type, so you select all the users you want displayed. I'm having trouble showing each user's photo though. This works:
  
  ```
  {% for user in block.staffList.all() %}
     Image URL: {{ craft.assets.id(user.photoId).one().url }}
  {% endfor %}
  
  ```
  
  But seems far from the ideal solution. Is there a more graceful way to do this?
  
  **Tags:** users
  
  > **Comments:**
  > **username_0**: Ok, this works: `{{ user.photoUrl(user.id) }}`, but still seems a little redundant  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-26. Score: 2 | Accepted answer
  
  It works very simply. Note that the photo field is an **asset object**, not an array of asset objects.
  
  ```
  {% for user in block.staffList.all() %}
     Image URL: {{ user.photo.getUrl() }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: That's the ticket, thanks! Just a quick note: to skip over people that don't have photos, you can use `{% if member.photo is not null %}`  
  > **username_1**: @username_0 Of course, you can still do eager loading and caching  **{% for user in block.staffList.with(['photo']).all() %}** . I gave a short answer, Craft CMS has many methods to optimize.  
  
  ---
  
  