<p>Actually, the <a href="https://craftcms.com/classreference/helpers/UrlHelper#getResourceUrl-detail" rel="nofollow noreferrer"><code>resourceUrl()</code></a> method doesn't care about the resource file's extension and is able to serve up SVGs (and any other filetype) just fine, so there must be something else wrong. Most likely, the path (i.e. <code>cocktailrecipes/images/gin.svg</code>) to the file isn't correct. </p>

<p>If your plugin has the handle <code>cocktailrecipes</code> (all lowercase; the handle should be identical to your plugin's folder under <code>/craft/plugins</code>), for your particular example Craft will expect to find your file under <code>/craft/plugins/cocktailrecipes/resources/images/gin.svg</code> – first thing to check, is if that file is actually in that location.</p>

CC BY-SA 3.0
2017-09-13T15:39:05.127Z
2017-09-13T15:39:05.127Z
Mats Mikkel Rummelhoff
<p>I have an SVG file in my plugins resources, I'd like to use the asset in the front end.</p>

<pre><code>{{ resourceUrl('cocktailrecipes/images/gin.svg') }
</code></pre>

<p>It seems using the <a href="https://craftcms.com/docs/plugins/resources" rel="nofollow noreferrer">resourceURL()</a> only allows a select few image types. </p>

<p>Is there a way to extend the permitted image types to include '.svg'?</p>

<plugins><resources><svg>
Requesting SVGs from a plugins resources directory doesn't work
# Requesting SVGs from a plugins resources directory doesn't work

(Asked by: username_0 on 2017-09-13)

I have an SVG file in my plugins resources, I'd like to use the asset in the front end.
{{ resourceUrl('cocktailrecipes/images/gin.svg') }

It seems using the resourceURL() only allows a select few image types. 
Is there a way to extend the permitted image types to include '.svg'?

**Tags:** plugins, resources, svg


---

## 1 answers

### Answer by username_1 on 2017-09-13. Score: 1

Actually, the [`resourceUrl()`](https://craftcms.com/classreference/helpers/UrlHelper#getResourceUrl-detail) method doesn't care about the resource file's extension and is able to serve up SVGs (and any other filetype) just fine, so there must be something else wrong. Most likely, the path (i.e. `cocktailrecipes/images/gin.svg`) to the file isn't correct.

If your plugin has the handle `cocktailrecipes` (all lowercase; the handle should be identical to your plugin's folder under `/craft/plugins`), for your particular example Craft will expect to find your file under `/craft/plugins/cocktailrecipes/resources/images/gin.svg` – first thing to check, is if that file is actually in that location.


---

