Answers.Body: <p>Remove the single quotes around wideCrop.</p>
  
  <pre><code>&lt;img class="full" src="{{ image.getUrl(wideCrop) }}"&gt; 
  </code></pre>
  
  <p><a href="https://craftcms.com/docs/image-transforms" rel="nofollow">Details for why the difference in "template defined" transforms here:</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-15T23:32:01.390Z
Answers.Text: Thanks so much. I can't believe I missed the quote marks. Too much code, not enough sleep. :)
Answers.UserDisplayName: glider
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-15T23:00:34.440Z
Answers.LastActivityDate: 2016-08-15T23:06:11.177Z
Answers.LastEditDate: 2016-08-15T23:06:11.177Z
Answers.UserDisplayName: AbbeyDesign
Body: <p>I've got a Matrix field with an image. If I use a pre-defined transform that's defined in Assets everything works fine. However, I need to set a transform manually in the template but it keeps returning an error "The transform “wideCrop” cannot be found!". I have used transforms in templates all over the site that work fine so I'm puzzled why this particular one isn't working. </p>
  
  <p>This is from an embedded template inside the entry:</p>
  
  <pre><code>{% for block in entry.contents %}
      {% for image in block.image %}          
  
          {% switch block.position %}
              {% case 'full' %}
                  {% set wideCrop = { width: 940, height: 360, mode: 'fit' } %}
                  &lt;img class="full" src="{{ image.getUrl('wideCrop') }}"&gt;   
          {% endswitch %}
  
      {% endfor %}
  {% endfor %} 
  </code></pre>
  
  <p>Thanks in advance!</p>
  
Tags: <assets><image-transforms>
Title: Transform cannot be found
ThreadText: # Transform cannot be found
  
  (Asked by: username_0 on 2016-08-15)
  
  I've got a Matrix field with an image. If I use a pre-defined transform that's defined in Assets everything works fine. However, I need to set a transform manually in the template but it keeps returning an error "The transform “wideCrop” cannot be found!". I have used transforms in templates all over the site that work fine so I'm puzzled why this particular one isn't working.
  
  This is from an embedded template inside the entry:
  
  ```
  {% for block in entry.contents %}
      {% for image in block.image %}          
  
          {% switch block.position %}
              {% case 'full' %}
                  {% set wideCrop = { width: 940, height: 360, mode: 'fit' } %}
                  <img class="full" src="{{ image.getUrl('wideCrop') }}">   
          {% endswitch %}
  
      {% endfor %}
  {% endfor %} 
  
  ```
  
  Thanks in advance!
  
  **Tags:** assets, image-transforms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-08-15. Score: 4 | Accepted answer
  
  Remove the single quotes around wideCrop.
  
  ```
  <img class="full" src="{{ image.getUrl(wideCrop) }}"> 
  
  ```
  
  [Details for why the difference in "template defined" transforms here:](https://craftcms.com/docs/image-transforms)
  
  > **Comments:**
  > **username_0**: Thanks so much. I can't believe I missed the quote marks. Too much code, not enough sleep. :)  
  
  ---
  
  