<p>Never used the plugin before, but from glancing at their docs, it looks like <code>entry.icons.icon</code> is what you're looking for.</p>

<p>Any other properties on their <a href="https://github.com/fyrebase/svg-icons#svgiconsmodel" rel="nofollow noreferrer">SvgIconsModel</a> should work as well.</p>

CC BY-SA 3.0
2017-04-23T00:34:35.960Z
Oh, I see how it is, Brad.
Stephen Lewis
CC BY-SA 3.0
2017-04-23T00:53:54.430Z
@StephenLewis I can't help it you have issues committing.
Brad Bell
CC BY-SA 3.0
2017-04-23T01:09:09.437Z
Brad Bell, Chief Officer of Community Knowledge.
Stephen Lewis
CC BY-SA 3.0
2017-04-23T11:32:59.127Z
That works, but I still don't see where it says that in the docs. I would've expected the docs to specifically say something like {{ entry.fieldname.icons }}
CreateSean
CC BY-SA 3.0
2017-04-22T23:39:09.200Z
2017-04-22T23:39:09.200Z
Brad Bell
<p>I've added a field called <strong>icons</strong> of type <a href="https://github.com/fyrebase/svg-icons" rel="nofollow noreferrer">svg-icons</a> and am able to select icons I've added without an issue. I am having trouble outputting them on the front end however. I get twig errors no matter what I try.</p>

<p>Have done <code>{{ dump(entry.icons) }}</code> and get the following output where you can see 11 lines from the bottom the path and name of the select svg icon. </p>

<p>How do I output that to the template?</p>

<pre><code>D:\path\to\craft\app\vendor\twig\twig\lib\Twig\Extension\Debug.php:56:
object(Craft\SvgIconsModel)[700]
  protected 'classSuffix' =&gt; string 'Model' (length=5)
  protected 'strictAttributes' =&gt; boolean true
  private '_classHandle' (Craft\BaseModel) =&gt; null
  private '_attributeConfigs' (Craft\BaseModel) =&gt; 
    array (size=6)
      'icon' =&gt; 
        array (size=2)
          'default' =&gt; null
          'type' =&gt; string 'string' (length=6)
      'sprite' =&gt; 
        array (size=2)
          'default' =&gt; null
          'type' =&gt; string 'string' (length=6)
      'type' =&gt; 
        array (size=2)
          'default' =&gt; null
          'type' =&gt; string 'string' (length=6)
      'resource' =&gt; 
        array (size=2)
          'default' =&gt; null
          'type' =&gt; string 'string' (length=6)
      'width' =&gt; 
        array (size=9)
          'maxLength' =&gt; int 11
          'min' =&gt; float -2147483648
          'max' =&gt; float 2147483647
          'decimals' =&gt; int 0
          'default' =&gt; null
          'type' =&gt; string 'number' (length=6)
          'unsigned' =&gt; boolean false
          'length' =&gt; int 11
          'column' =&gt; string 'integer' (length=7)
      'height' =&gt; 
        array (size=9)
          'maxLength' =&gt; int 11
          'min' =&gt; float -2147483648
          'max' =&gt; float 2147483647
          'decimals' =&gt; int 0
          'default' =&gt; null
          'type' =&gt; string 'number' (length=6)
          'unsigned' =&gt; boolean false
          'length' =&gt; int 11
          'column' =&gt; string 'integer' (length=7)
  private '_attributes' (Craft\BaseModel) =&gt; 
    array (size=3)
      'icon' =&gt; string 'general\design.svg' (length=18)
      'width' =&gt; float 512
      'height' =&gt; float 512
  private '_extraAttributeNames' (Craft\BaseModel) =&gt; null
  private '_errors' (CModel) =&gt; 
    array (size=0)
      empty
  private '_validators' (CModel) =&gt; null
  private '_scenario' (CModel) =&gt; string '' (length=0)
  private '_e' (CComponent) =&gt; null
  private '_m' (CComponent) =&gt; null
</code></pre>

CC BY-SA 3.0
2017-04-22T20:53:48.693Z
Have you tried `{{ entry.icons.icon }}`?
Stephen Lewis
<templating><error><svg>
svgicons fieldtype - how to output in template?
# svgicons fieldtype - how to output in template?

(Asked by: username_0 on 2017-04-22)

I've added a field called icons of type svg-icons and am able to select icons I've added without an issue. I am having trouble outputting them on the front end however. I get twig errors no matter what I try.
Have done {{ dump(entry.icons) }} and get the following output where you can see 11 lines from the bottom the path and name of the select svg icon. 
How do I output that to the template?
D:\path\to\craft\app\vendor\twig\twig\lib\Twig\Extension\Debug.php:56:
object(Craft\SvgIconsModel)[700]
  protected 'classSuffix' => string 'Model' (length=5)
  protected 'strictAttributes' => boolean true
  private '_classHandle' (Craft\BaseModel) => null
  private '_attributeConfigs' (Craft\BaseModel) => 
    array (size=6)
      'icon' => 
        array (size=2)
          'default' => null
          'type' => string 'string' (length=6)
      'sprite' => 
        array (size=2)
          'default' => null
          'type' => string 'string' (length=6)
      'type' => 
        array (size=2)
          'default' => null
          'type' => string 'string' (length=6)
      'resource' => 
        array (size=2)
          'default' => null
          'type' => string 'string' (length=6)
      'width' => 
        array (size=9)
          'maxLength' => int 11
          'min' => float -2147483648
          'max' => float 2147483647
          'decimals' => int 0
          'default' => null
          'type' => string 'number' (length=6)
          'unsigned' => boolean false
          'length' => int 11
          'column' => string 'integer' (length=7)
      'height' => 
        array (size=9)
          'maxLength' => int 11
          'min' => float -2147483648
          'max' => float 2147483647
          'decimals' => int 0
          'default' => null
          'type' => string 'number' (length=6)
          'unsigned' => boolean false
          'length' => int 11
          'column' => string 'integer' (length=7)
  private '_attributes' (Craft\BaseModel) => 
    array (size=3)
      'icon' => string 'general\design.svg' (length=18)
      'width' => float 512
      'height' => float 512
  private '_extraAttributeNames' (Craft\BaseModel) => null
  private '_errors' (CModel) => 
    array (size=0)
      empty
  private '_validators' (CModel) => null
  private '_scenario' (CModel) => string '' (length=0)
  private '_e' (CComponent) => null
  private '_m' (CComponent) => null

**Tags:** templating, error, svg
> **Comments:**
> **username_1**: Have you tried `{{ entry.icons.icon }}`?  

---

## 1 answers

### Answer by username_2 on 2017-04-22. Score: 1 | Accepted answer

Never used the plugin before, but from glancing at their docs, it looks like `entry.icons.icon` is what you're looking for.

Any other properties on their [SvgIconsModel](https://github.com/fyrebase/svg-icons#svgiconsmodel) should work as well.

> **Comments:**
> **username_1**: Oh, I see how it is, Brad.  
> **username_2**: @StephenLewis I can't help it you have issues committing.  
> **username_1**: Brad Bell, Chief Officer of Community Knowledge.  
> **username_0**: That works, but I still don't see where it says that in the docs. I would've expected the docs to specifically say something like {{ entry.fieldname.icons }}  

---

