<p>I've given up on this, from what I've looked at it's not going to be easy without a migration that creates the fields first (don't really want to do this for updatability issues). I've changed the scope of the plugin to be more bare-bones, and I think it's better for it.</p>

CC BY-SA 4.0
2020-10-27T10:17:04.293Z
2020-10-27T10:17:04.293Z
dmatthams
<p>I've created an element type and want to have a 'Categories' and 'Tags' field built-in (the sources for each will be selectable in settings), but can't figure out the best way to go about this whilst supporting custom field layouts with tabs.</p>
<p>Do I just hard-code these fields into the edit page/hud html code then handle the logic on the save controller (this is fiddly whilst keeping it customisable/tab-able), or is there a better way to do it? I.e inject them into the field layout via the controller?</p>
<p>Can't get my head around this one.</p>

<plugin-development><elementtype>
Element type with 'baked-in' fields
# Element type with 'baked-in' fields

(Asked by: username_0 on 2020-10-21)

I've created an element type and want to have a 'Categories' and 'Tags' field built-in (the sources for each will be selectable in settings), but can't figure out the best way to go about this whilst supporting custom field layouts with tabs.

Do I just hard-code these fields into the edit page/hud html code then handle the logic on the save controller (this is fiddly whilst keeping it customisable/tab-able), or is there a better way to do it? I.e inject them into the field layout via the controller?

Can't get my head around this one.

**Tags:** plugin-development, elementtype

---

## 1 answers

### Answer by username_0 on 2020-10-27. Score: 2 | Accepted answer

I've given up on this, from what I've looked at it's not going to be easy without a migration that creates the fields first (don't really want to do this for updatability issues). I've changed the scope of the plugin to be more bare-bones, and I think it's better for it.


---

