Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-13T15:39:05.127Z
Answers.LastActivityDate: 2017-09-13T15:39:05.127Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <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>
  
Tags: <plugins><resources><svg>
Title: Requesting SVGs from a plugins resources directory doesn't work
ThreadText: # 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()](https://craftcms.com/docs/plugins/resources) 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.
  
  
  ---
  
  