Answers.Body: <p>This is more of a suggestion than a real answer (assuming the <code>folderId</code> and filename are correct, what you've got should probably work), but anyway:</p>
  
  <p>I'd strongly advise against hard coding an Asset into a template like this. By creating a <a href="https://craftcms.com/docs/globals" rel="nofollow">Global set</a> with an Assets field, you'll save yourself a lot of (potential) trouble, both short and long term.</p>
  
  <p>Here's how your code could look using a Global set called <code>siteSettings</code>, with an Assets field called <code>noMorePostsImage</code>:</p>
  
  <pre><code>{% set asset = siteSettings.noMorePostsImage.first() %}
  {% set thumb = {
      mode: 'crop',
      width: 800,
      height: 600,
      quality: 75,
      position: 'center-center'
  } %}
  {% if asset %}
      &lt;img alt="No More Posts" class="img-responsive center-block" src="{{ asset.getUrl(thumb) }}" /&gt;
  {% endif %}
  </code></pre>
  
  <p>So, the code is (a little bit) simpler than what you currently have, and (more importantly) the chance of something going wrong is much smaller. As a bonus, it'll be much simpler to change the image later on, should the need arise. You'll also avoid future issues if someone e.g. moves or renames the Asset from inside Craft.</p>
  
  <p>If your content editor(s) shouldn't be able to change or remove the image, you can simply exclude the Global set from your content editors' user group permissions (assuming you're not running Craft Personal, of course).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-24T15:46:53.073Z
Answers.Text: That worked perfectly! Thanks for introducing Globals to me. I had not even looked at this feature of craft.
Answers.UserDisplayName: hvs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-24T16:07:39.683Z
Answers.Text: Awesome, very happy it helped you out :)
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-22T11:27:11.527Z
Answers.LastActivityDate: 2016-10-22T11:27:11.527Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <p>I am trying to call an image in my twig template whose identity is known. Here is my code that does not work</p>
  
  <pre><code>{% set asset = craft.assets.kind('image').folderId('9').filename('fitness-strength-strong-male-1.jpg') %}
  
  {% set thumb = {
      mode: 'crop',
      width: 800,
      height: 600,
      quality: 75,
      position: 'center-center'
  } %}
  
   {% if asset %}
      &lt;img alt="No More Posts" class="img-responsive center-block" src="{{ asset.getUrl(thumb) }}" &gt;
   {% endif %}    
  </code></pre>
  
  <p>This is not working at all. My <code>folderId</code> is correct (got it from <code>craft_assetfolders</code> table) and filename is copied and pasted. Not sure what I am doing wrong.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-21T21:44:25.017Z
Comments.Text: What happen if you do: `{% set asset = craft.assets.filename('fitness-strength-strong-male-1.jpg') %}`?
Comments.UserDisplayName: Brad Bell
Tags: <templating>
Title: How to make calls to render a fixed asset
ThreadText: # How to make calls to render a fixed asset
  
  (Asked by: username_0 on 2016-10-21)
  
  I am trying to call an image in my twig template whose identity is known. Here is my code that does not work
  
  ```
  {% set asset = craft.assets.kind('image').folderId('9').filename('fitness-strength-strong-male-1.jpg') %}
  
  {% set thumb = {
      mode: 'crop',
      width: 800,
      height: 600,
      quality: 75,
      position: 'center-center'
  } %}
  
   {% if asset %}
      <img alt="No More Posts" class="img-responsive center-block" src="{{ asset.getUrl(thumb) }}" >
   {% endif %}    
  
  ```
  
  This is not working at all. My `folderId` is correct (got it from `craft_assetfolders` table) and filename is copied and pasted. Not sure what I am doing wrong.
  
  **Tags:** templating
  
  > **Comments:**
  > **username_1**: What happen if you do: `{% set asset = craft.assets.filename('fitness-strength-strong-male-1.jpg') %}`?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-10-22. Score: 2 | Accepted answer
  
  This is more of a suggestion than a real answer (assuming the `folderId` and filename are correct, what you've got should probably work), but anyway:
  
  I'd strongly advise against hard coding an Asset into a template like this. By creating a [Global set](https://craftcms.com/docs/globals) with an Assets field, you'll save yourself a lot of (potential) trouble, both short and long term.
  
  Here's how your code could look using a Global set called `siteSettings`, with an Assets field called `noMorePostsImage`:
  
  ```
  {% set asset = siteSettings.noMorePostsImage.first() %}
  {% set thumb = {
      mode: 'crop',
      width: 800,
      height: 600,
      quality: 75,
      position: 'center-center'
  } %}
  {% if asset %}
      <img alt="No More Posts" class="img-responsive center-block" src="{{ asset.getUrl(thumb) }}" />
  {% endif %}
  
  ```
  
  So, the code is (a little bit) simpler than what you currently have, and (more importantly) the chance of something going wrong is much smaller. As a bonus, it'll be much simpler to change the image later on, should the need arise. You'll also avoid future issues if someone e.g. moves or renames the Asset from inside Craft.
  
  If your content editor(s) shouldn't be able to change or remove the image, you can simply exclude the Global set from your content editors' user group permissions (assuming you're not running Craft Personal, of course).
  
  > **Comments:**
  > **username_0**: That worked perfectly! Thanks for introducing Globals to me. I had not even looked at this feature of craft.  
  > **username_2**: Awesome, very happy it helped you out :)  
  
  ---
  
  