Answers.Body: <p>What field type is blog_featured_image? Just an image asset?
  Does it work with</p>
  
  <p><code>&lt;img src="{{ asset.getUrl() }}" alt="{{asset.title}}" /&gt;</code> ?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T04:51:43.967Z
Answers.Text: The blog_featured_image is just an image asset.
Answers.UserDisplayName: FuzzyJelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T04:57:18.520Z
Answers.Text: I attempted to use it within the ElementCriteriaModel doc (https://craftcms.com/docs/templating/craft.assets) but I couldn't get it to work.
  
  The base path and base url in the Settings > Assets are produced exactly (if I use {siteUrl} it outputs {siteUrl}assets/images rather than "http://example.com/assets/images"
  
  Unfortunately, using the same code you suggested didn't do it either. I'm missing something obvious, I'm sure, but I can't find it.
Answers.UserDisplayName: FuzzyJelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T08:22:50.693Z
Answers.Text: How does your general.php look like? Maybe a typo there?
Answers.UserDisplayName: Andreas
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T15:27:24.310Z
Answers.Text: There are no additional settings in general.php yet, I tried adding some siteUrl updates and have since removed them, so now it's empty. I realize now that it's the siteUrl that I added into the asset settings that's being passed through, so I think my question is answered and I need to research dynamic asset settings paths. Thank you!
Answers.UserDisplayName: FuzzyJelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-19T15:30:53.410Z
Answers.LastActivityDate: 2017-01-19T15:30:53.410Z
Answers.UserDisplayName: Andreas
Answers.Body: <p>You need the <code>.getUrl();</code> I also suggest that you have a look at the <a href="https://github.com/aelvan/Imager-Craft" rel="nofollow noreferrer">Imager plugin</a> for a more flexible use of images in your site.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T05:05:03.777Z
Answers.Text: asset.getUrl() DOES get the url, but it omits the main base url (in this instance "localhost/public/" and leaves in {siteUrl} in the finished code: ( I.E. {{asset.getUrl()}} == "{siteUrl}assets/filename.jpg" )
Answers.UserDisplayName: FuzzyJelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-19T18:02:59.137Z
Answers.LastActivityDate: 2017-01-19T18:02:59.137Z
Answers.UserDisplayName: Jan_dh
Body: <p>I'm very new at Craft templating, and I can't seem to get an asset to link correctly in the browser.</p>
  
  <pre><code>{% block content %}
      &lt;article&gt;
          &lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
          {{ siteUrl }}
          &lt;p&gt;Posted on {{ entry.postDate.format('F d, Y') }}&lt;/p&gt;
          {{ entry.blog_body }}
          {% for asset in entry.blog_featured_image %}
              &lt;img src="{{asset.url}}" alt="{{asset.title}}" /&gt;
          {% endfor %}
      &lt;/article&gt;
  {% endblock %}
  </code></pre>
  
  <p>Becomes this:</p>
  
  <pre><code>&lt;article&gt;
    &lt;h1&gt;New Blog 1&lt;/h1&gt;
    http://localhost/craftcms/public/
    &lt;p&gt;Posted on January 15, 2017&lt;/p&gt;
    &lt;p&gt;"Body Text"&lt;/p&gt;
    &lt;img src="{{ siteUrl }}assets/images/image.png" alt="title"&gt;
  &lt;/article&gt;
  </code></pre>
  
  <p>when output to a browser.</p>
  
  <p>{{ siteUrl }} will display the path just fine, but when I'm using {{asset.url}} and it gets changed to {{siteUrl}} it doesn't create the path, it just stays at siteUrl. This is really confusing me.</p>
  
  <p>Why doesn't {{ siteUrl }} return the base path when it's used in the asset.url?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-19T17:16:45.500Z
Comments.Text: In your asset settings for that source do you have something like `{{ siteUrl }}/images` in the input field? If so, try changing it to `{siteUrl}` and see if that helps.
Comments.UserDisplayName: Alec Ritson
Tags: <assets><siteurl>
Title: Localhost: Why does {{ asset.url }} return {{siteUrl}}/path in the browser?
ThreadText: # Localhost: Why does {{ asset.url }} return {{siteUrl}}/path in the browser?
  
  (Asked by: username_0 on 2017-01-15)
  
  I'm very new at Craft templating, and I can't seem to get an asset to link correctly in the browser.
  
  ```
  {% block content %}
      <article>
          <h1>{{ entry.title }}</h1>
          {{ siteUrl }}
          <p>Posted on {{ entry.postDate.format('F d, Y') }}</p>
          {{ entry.blog_body }}
          {% for asset in entry.blog_featured_image %}
              <img src="{{asset.url}}" alt="{{asset.title}}" />
          {% endfor %}
      </article>
  {% endblock %}
  
  ```
  
  Becomes this:
  
  ```
  <article>
    <h1>New Blog 1</h1>
    http://localhost/craftcms/public/
    <p>Posted on January 15, 2017</p>
    <p>"Body Text"</p>
    <img src="{{ siteUrl }}assets/images/image.png" alt="title">
  </article>
  
  ```
  
  when output to a browser.
  
  {{ siteUrl }} will display the path just fine, but when I'm using {{asset.url}} and it gets changed to {{siteUrl}} it doesn't create the path, it just stays at siteUrl. This is really confusing me.
  
  Why doesn't {{ siteUrl }} return the base path when it's used in the asset.url?
  
  **Tags:** assets, siteurl
  
  > **Comments:**
  > **username_1**: In your asset settings for that source do you have something like `{{ siteUrl }}/images` in the input field? If so, try changing it to `{siteUrl}` and see if that helps.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-01-19. Score: 2 | Accepted answer
  
  What field type is blog\_featured\_image? Just an image asset?
  Does it work with
  
  `<img src="{{ asset.getUrl() }}" alt="{{asset.title}}" />` ?
  
  > **Comments:**
  > **username_0**: The blog_featured_image is just an image asset.  
  > **username_0**: I attempted to use it within the ElementCriteriaModel doc (https://craftcms.com/docs/templating/craft.assets) but I couldn't get it to work.  The base path and base url in the Settings > Assets are produced exactly (if I use {siteUrl} it outputs {siteUrl}assets/images rather than "http://example.com/assets/images"  Unfortunately, using the same code you suggested didn't do it either. I'm missing something obvious, I'm sure, but I can't find it.  
  > **username_2**: How does your general.php look like? Maybe a typo there?  
  > **username_0**: There are no additional settings in general.php yet, I tried adding some siteUrl updates and have since removed them, so now it's empty. I realize now that it's the siteUrl that I added into the asset settings that's being passed through, so I think my question is answered and I need to research dynamic asset settings paths. Thank you!  
  
  ---
  
  ### Answer by username_3 on 2017-01-19. Score: 1
  
  You need the `.getUrl();` I also suggest that you have a look at the [Imager plugin](https://github.com/aelvan/Imager-Craft) for a more flexible use of images in your site.
  
  > **Comments:**
  > **username_0**: asset.getUrl() DOES get the url, but it omits the main base url (in this instance "localhost/public/" and leaves in {siteUrl} in the finished code: ( I.E. {{asset.getUrl()}} == "{siteUrl}assets/filename.jpg" )  
  
  ---
  
  