<p>What you are describing sounds a lot like the <a href="https://github.com/hybridinteractive/craft-position-fieldtype" rel="nofollow noreferrer">Position Fieldtype</a>. I would look at that plugin for guidance.</p>

CC BY-SA 4.0
2020-07-20T19:10:17.007Z
2020-07-20T19:10:17.007Z
Marion Newlevant
<p>I use the same icons across most of my projects, and typically just list them in Dropdown fields. However, this quickly becomes difficult to manage, so I'm looking to create a simple plugin that I can easily reuse.</p>
<p>I've started with pluginfactory.io to scaffold it out, selecting the Field Types component and installed via Composer but struggling from there.</p>
<ul>
<li>How do I define the list of icons that should show in the dropdown field?</li>
<li>How do I get that to then reference the correct SVG file?</li>
<li>How do I output that properly in my templates with <code>{{ entry.icon }}</code>?</li>
</ul>
<p>I realise that's literally asking how to build this thing  but I would appreciate some guidance!</p>

<plugin-development>
Looking to create a dropdown field to select an icon
# Looking to create a dropdown field to select an icon

(Asked by: username_0 on 2020-07-19)

I use the same icons across most of my projects, and typically just list them in Dropdown fields. However, this quickly becomes difficult to manage, so I'm looking to create a simple plugin that I can easily reuse.

I've started with pluginfactory.io to scaffold it out, selecting the Field Types component and installed via Composer but struggling from there.

* How do I define the list of icons that should show in the dropdown field?
* How do I get that to then reference the correct SVG file?
* How do I output that properly in my templates with `{{ entry.icon }}`?

I realise that's literally asking how to build this thing but I would appreciate some guidance!

**Tags:** plugin-development

---

## 1 answers

### Answer by username_1 on 2020-07-20. Score: 1

What you are describing sounds a lot like the [Position Fieldtype](https://github.com/hybridinteractive/craft-position-fieldtype). I would look at that plugin for guidance.


---

