Answers.Body: <p>By the way, is your Craft CMS version 3.x? If so, using &quot;one&quot; is recommended instead of &quot;first&quot;, which is deprecated.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-22T09:25:42.700Z
Answers.Text: Yes, I tried that too. Nothing seems to work to get the file path
Answers.UserDisplayName: Fritko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T13:37:03.200Z
Answers.LastActivityDate: 2020-09-11T13:37:03.200Z
Answers.UserDisplayName: Kota.M
Answers.Body: <p>Is the &quot;Assets in this volume have public URLs&quot; turned on?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T12:11:30.587Z
Answers.Text: It wasn't before. But I found it a little later and turned it on. Still frontend won't show the image nor an error. Noticed thumbnails in CP show, but if I click to preview it, the image is 404.
Answers.UserDisplayName: Fritko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T13:06:11.547Z
Answers.Text: Maybe you defined wrong path in volume - what is there? What is the path that errors out 404?
Answers.UserDisplayName: Ottó Radics
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-22T09:25:14.743Z
Answers.Text: I guess not, because getting the filename works. There must be something wrong with the output
Answers.UserDisplayName: Fritko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-23T10:55:17.110Z
Answers.Text: What have you set as base URL for the volume?
Answers.UserDisplayName: Ottó Radics
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-11T10:53:03.863Z
Answers.LastActivityDate: 2020-09-11T10:53:03.863Z
Answers.UserDisplayName: Ottó Radics
Body: <p>I am on my first Craft CMS test site. Have some problems showing a simple image.</p>
  <pre><code>&lt;img src=&quot;{{ entry.hero.first().url }}&quot; title=&quot;{{ hero.title }}&quot;&gt;
  </code></pre>
  <p>I get the title but can't get the URL. The src attr is always empty. Tried a couple of variants like:</p>
  <ul>
  <li><code>entry.hero.first().url()</code></li>
  <li><code>entry.hero.first().getUrl()</code></li>
  <li>with and without ()</li>
  <li>etc.</li>
  </ul>
  <p>But <code>entry.hero.first().filename</code> gives me &quot;my_testfile01.jpg&quot;</p>
  <p>I can't see what is wrong.</p>
  <p>File is local with path set to &quot;./&quot;
  Image field has no sub path.</p>
  <p>MAMP (Apache + PHP 7)</p>
  
Tags: <templating><image>
Title: {{ entry.image.first().url }} won't show image
ThreadText: # {{ entry.image.first().url }} won't show image
  
  (Asked by: username_0 on 2020-09-11)
  
  I am on my first Craft CMS test site. Have some problems showing a simple image.
  
  ```
  <img src="{{ entry.hero.first().url }}" title="{{ hero.title }}">
  
  ```
  
  I get the title but can't get the URL. The src attr is always empty. Tried a couple of variants like:
  
  * `entry.hero.first().url()`
  * `entry.hero.first().getUrl()`
  * with and without ()
  * etc.
  
  But `entry.hero.first().filename` gives me "my\_testfile01.jpg"
  
  I can't see what is wrong.
  
  File is local with path set to "./"
  Image field has no sub path.
  
  MAMP (Apache + PHP 7)
  
  **Tags:** templating, image
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-09-11. Score: 2
  
  By the way, is your Craft CMS version 3.x? If so, using "one" is recommended instead of "first", which is deprecated.
  
  > **Comments:**
  > **username_0**: Yes, I tried that too. Nothing seems to work to get the file path  
  
  ---
  
  ### Answer by username_2 on 2020-09-11. Score: 1
  
  Is the "Assets in this volume have public URLs" turned on?
  
  > **Comments:**
  > **username_0**: It wasn't before. But I found it a little later and turned it on. Still frontend won't show the image nor an error. Noticed thumbnails in CP show, but if I click to preview it, the image is 404.  
  > **username_2**: Maybe you defined wrong path in volume - what is there? What is the path that errors out 404?  
  > **username_0**: I guess not, because getting the filename works. There must be something wrong with the output  
  > **username_2**: What have you set as base URL for the volume?  
  
  ---
  
  