# Adding Custom Fields via Plugin Outlet

**URL:** https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003
**Category:** Development
**Created:** [February 13, 2019, 3:23am UTC](https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003 "2019-02-13T03:23:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![zaino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zaino/32/130057_2.png) [@zaino](https://meta.discourse.org/u/zaino)
#### Post date: [February 13, 2019, 3:23am UTC](https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003/1 "2019-02-13T03:23:59Z")

</div>

In my custom theme, I am attempting to create custom user fields using the plugin-outlet at preferences/profile and I am part way there.

I have successfully inserted new custom fields into User Preferences, but the information I entered into the UI does not stick after clicking save.

For example, I created this checkbox like this:

```
       <script type="text/x-handlebars" data-template-name="preferences/profile"> [all the other code]
<div class="control-group pref-check1">
  <label class="control-label">I like beer</label>
  <div class="controls">
    {{input type="checkbox" name="check1" value="true" class="input-xxlarge"}}
  </div>
</div>
</script>

```

What do I need to do to save the info entered in the preferences UI (and then display it in the /user template)? Is this possible with a custom theme?

* * *

Why am I doing this?

I am aware that you can create custom user fields under settings. I have a 3-4 different types of user custom fields for which I want finer control over the visual display on the user profile. For example some fields are text and some are true/false.

Since all custom user fields have the same class this is difficult. And I find :nth-child() a pain.

So my goal is to insert them into the template and control their classes and display.

I am interested in guidance specific to my first question and to my larger goal.

Cheers

---

<div class="post-metadata">

### Author: ![zaino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zaino/32/130057_2.png) [@zaino](https://meta.discourse.org/u/zaino)
#### Post date: [February 14, 2019, 1:26am UTC](https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003/2 "2019-02-14T01:26:33Z")

</div>

Update. I ended up accomplishing my end goal with CSS without too much pain.

I realize that creating custom fields outside of the UI provided is more complicated than what I described above. I would be interested in eventually learning how to do this if anyone can point me to the right resources.

Having a great time learning how to develop Discourse!

Thanks!

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [February 14, 2019, 3:22pm UTC](https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003/3 "2019-02-14T15:22:19Z")

</div>

Discourse Cakeday adds some custom fields to the user profile.

[https://github.com/discourse/discourse-cakeday](https://github.com/discourse/discourse-cakeday)

Probably the best way to approach this is find where those custom fields are added in the code (both the Ember front-end and the Rails back-end).

---

<div class="post-metadata">

### Author: ![zaino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zaino/32/130057_2.png) [@zaino](https://meta.discourse.org/u/zaino)
#### Post date: [February 14, 2019, 8:25pm UTC](https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003/4 "2019-02-14T20:25:07Z")

</div>

Cool , will check it out. Many thanks !

---

<div class="post-metadata">

### Author: ![Dev\_Work](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dev_work/32/124200_2.png) [@Dev\_Work](https://meta.discourse.org/u/Dev_Work)
#### Post date: [December 19, 2019, 10:50am UTC](https://meta.discourse.org/t/adding-custom-fields-via-plugin-outlet/109003/5 "2019-12-19T10:50:35Z")

</div>

Where method is the creation of the field?  
(redoing the plugin for myself)
