Answers.Body: <p>Something like this should do it:</p>
  
  <pre><code>{% set heroImage = entry.heroImage.one().getUrl() %}
  </code></pre>
  
  <p>Although this probably works as well:</p>
  
  <pre><code>{% set heroImage = entry.heroImage.one().url %}
  </code></pre>
  
  <p>In Craft 3, <code>.first()</code> has been replaced with <code>.one()</code>.  <a href="https://docs.craftcms.com/v3/changes-in-craft-3.html#query-methods" rel="nofollow noreferrer">https://docs.craftcms.com/v3/changes-in-craft-3.html#query-methods</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-08-30T21:53:08.857Z
Answers.LastActivityDate: 2018-11-02T18:41:26.557Z
Answers.LastEditDate: 2018-11-02T18:41:26.557Z
Answers.UserDisplayName: Brad Bell
Body: <p>I am having a problem getting image urls from Craft 3. I understand that there is a new syntax but I cannot find the syntax to use. The craft 2 version of what I am trying to accomplish is</p>
  
  <pre><code>{% set heroImage = entry.heroImage.first().url %}
  </code></pre>
  
  <p>How do I achieve this in Craft 3?</p>
  
Tags: <templating><craft3>
Title: Craft 3 Template - Getting Image URLs
ThreadText: # Craft 3 Template - Getting Image URLs
  
  (Asked by: username_0 on 2017-08-30)
  
  I am having a problem getting image urls from Craft 3. I understand that there is a new syntax but I cannot find the syntax to use. The craft 2 version of what I am trying to accomplish is
  
  ```
  {% set heroImage = entry.heroImage.first().url %}
  
  ```
  
  How do I achieve this in Craft 3?
  
  **Tags:** templating, craft3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-08-30. Score: 4 | Accepted answer
  
  Something like this should do it:
  
  ```
  {% set heroImage = entry.heroImage.one().getUrl() %}
  
  ```
  
  Although this probably works as well:
  
  ```
  {% set heroImage = entry.heroImage.one().url %}
  
  ```
  
  In Craft 3, `.first()` has been replaced with `.one()`. <https://docs.craftcms.com/v3/changes-in-craft-3.html#query-methods>
  
  
  ---
  
  