<p>I believe a Reference Tag can not perform an image transform because it doesn't return an ElementCriteriaModel object.</p>

<p>I worked around this by using the craft asset id parameter:</p>

<pre><code>    {% set assetSearch  = craft.assets.id(12651) %}

    {{assetSearch.first().getUrl('transform')}}
</code></pre>

CC BY-SA 3.0
2016-10-13T14:56:57.950Z
Great solution, thnx!
Coen van der Kolk
CC BY-SA 3.0
2016-10-12T22:39:50.927Z
2016-10-13T15:25:43.253Z
2016-10-13T15:25:43.253Z
Rjoss
<p>I think you are forgetting to loop through the images. If not could you be clearer in your question?</p>

<p>It should work like this: </p>

<pre><code>{% for image in entry.imageHandle %}
    &lt;img src="('{{ image.getUrl('transform') }}')" width="{{ image.getWidth('transform') }}" height="{{ image.getHeight('transform') }}');"&gt;
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-10-07T08:56:32.903Z
Hi justin,

I would like to use the reference tags. To do that I need to parse the var as explained in: [link](https://craftcms.com/docs/reference-tags)
But as I don't just want the url back, I don't get how to parse the code to also do an image transfrom.
Regards
Coen van der Kolk
CC BY-SA 3.0
2016-10-07T07:54:04.383Z
2016-10-07T07:54:04.383Z
Justin Dekkers
<p>Can someone tell me how to do an image transform on a reference tag? I've tried</p>

<pre><code>{% set images %}
&lt;img src="{asset:123:getUrl('transform')}" /&gt;
&lt;img src="{asset:124:getUrl('transform')}" /&gt;
{% endset %}

{{ images|parseRefs|raw }}
</code></pre>

<p>But this just gives back the source urls and not the crops.</p>

<p>Regards</p>

<image-transforms><reference-tags>
image transform on reference tag
# image transform on reference tag

(Asked by: username_0 on 2016-10-07)

Can someone tell me how to do an image transform on a reference tag? I've tried
{% set images %}


{% endset %}

{{ images|parseRefs|raw }}

But this just gives back the source urls and not the crops.
Regards

**Tags:** image-transforms, reference-tags


---

## 2 answers

### Answer by username_1 on 2016-10-12. Score: 3 | Accepted answer

I believe a Reference Tag can not perform an image transform because it doesn't return an ElementCriteriaModel object.
I worked around this by using the craft asset id parameter:
    {% set assetSearch  = craft.assets.id(12651) %}

    {{assetSearch.first().getUrl('transform')}}

> **Comments:**
> **username_0**: Great solution, thnx!  

---

### Answer by username_2 on 2016-10-07. Score: 1

I think you are forgetting to loop through the images. If not could you be clearer in your question?
It should work like this: 
{% for image in entry.imageHandle %}
    
{% endfor %}

> **Comments:**
> **username_0**: Hi justin,  I would like to use the reference tags. To do that I need to parse the var as explained in: [link](https://craftcms.com/docs/reference-tags) But as I don't just want the url back, I don't get how to parse the code to also do an image transfrom. Regards  

---

