# Custom User fields on Usercard

**URL:** https://meta.discourse.org/t/custom-user-fields-on-usercard/22662
**Category:** Feature
**Tags:** user-card
**Created:** [November 29, 2014, 7:26pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662 "2014-11-29T19:26:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [November 29, 2014, 7:26pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/1 "2014-11-29T19:26:04Z")

</div>

I would like to have the ability to add the custom user fields on the users profile to show up on the usercard if filled out.

Example. We use discourse as a gaming community. I would like to have users gamer tags (Xbox live, Steam, etc..) to show up on the card if they filled them out in their profile.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [April 21, 2015, 3:02pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/2 "2015-04-21T15:02:06Z")

</div>

The custom user fields do show up on the user profile page now - not sure when that was implemented. But it does seem to be a bit halfbaked and is not especially configurable. And do not yet display on user cards.

What I’d like to display on user cards and user profiles is organizational affiliation as a link. But putting that HTML in the text field doesn’t work as expected. It includes the field title and the HTML is exposed - see screenshot.

What if we enabled the contents of a custom user field to be used as title? Or as a badge?

 ![](https://global.discourse-cdn.com/meta/original/3X/1/e/1e174bdf1c9d26f628d30205bb9b47544e5dce3c.png)

---

<div class="post-metadata">

### Author: ![yusf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yusf/32/107924_2.png) [@yusf](https://meta.discourse.org/u/yusf)
#### Post date: [May 4, 2015, 9:23pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/3 "2015-05-04T21:23:38Z")

</div>

Have any advancements been made on this feature? I’d welcome any hack to get it done at this point. 😄

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [July 13, 2015, 5:41pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/4 "2015-07-13T17:41:46Z")

</div>

One of our customers wants to extend the user card popup with a button that leads to the user’s profile on their home site.

As far as I can see it’s very hard to extend the user card.

Is there anyone who can give us a pointer how to do this and/or make this change as a plugin (as paid work) ?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [July 13, 2015, 10:47pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/5 "2015-07-13T22:47:41Z")

</div>

> [@michaeld](#):
>
> As far as I can see it’s very hard to extend the user card.

The User Card now has a plugin-outlet “user-card-metadata”

> [@Developing Discourse Plugins - Part 2 - Connect to a plugin outlet](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-2-plugin-outlets/31001):
>
> Previous tutorial: [Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/developing-discourse-plugins-part-1-create-a-basic-plugin/30515)Getting Started: Templates Discourse’s client application is written using the Ember.js Javascript framework. Ember uses [Templates](https://guides.emberjs.com/release/components/) to generate HTML. There’s a great introduction to the templating language at that link, so definitely read it thoroughly. The Problem: Adding elements to the Discourse User Interface Many plugins need to add and extend the Discourse web interface. We provide a mechanism to do this cal…

![](https://global.discourse-cdn.com/meta/original/3X/1/3/1351d36051304a9df7005cb759be077f87328526.png)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [March 19, 2016, 5:24pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/6 "2016-03-19T17:24:04Z")

</div>

This can now be done via:

> [@(Retired) Use an ID in a custom user field to link to a user's external profile](https://meta.discourse.org/t/link-custom-user-field-to-external-website/41218):
>
> Let’s say you want to add a link of User’s main profile page on Discourse user profile page and user card, clicking on that link will take user to main (external) website. The link of main website user profile page will be like: http://myawesomewebsite.com/user/USER\_PROFILE\_ID Let’s get started! Create a custom user field Let’s create a user field with name User Profile. Make sure “Show on public profile?” option is enabled. The above field will store external user profile IDs. A…

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [April 1, 2016, 2:05pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/7 "2016-04-01T14:05:59Z")

</div>

To display the user fields on the user card would be very useful for us. It saves some clicks and you keep focus on reading (instead of visiting the user’s page to see the field’s values). This would speed up our customer support and provides better usability.

Is there a plugin (no JS hack as mentioned above) for this yet? If not, I’d like to deal with this (already hacked it into my local discourse installation 🙂 ).

@sam what do you think, should I make a plugin or should I contribute to the discourse core (I already signed the Contributor License Agreement)? I thought about adding two options similar to the two existing ones…

 ![](https://global.discourse-cdn.com/meta/original/3X/5/5/55a5226c909d51948769bda05fd7f949de5b0699.png) 

…with captions:

- public custom fields on user card
- staff user custom fields on user card

(open to improvements 🙂 )

With this two extra options it would be possible to show only a _subset_ of user fields on the user card (to keep it small and clean) while showing a more complete set of (possibly many) user fields on the user’s detail page.

What do you think?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [April 1, 2016, 3:17pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/8 "2016-04-01T15:17:30Z")

</div>

> [@thorbenegberts](#):
>
> make a plugin or should I contribute to the discourse core

I won’t speak for Sam, but my take is demand and cost play a part in the decision.

Demand as in how many are asking for it, how many will use it.  
Cost as in developer time, though being open source can lessen this.

Don’t fool yourself into thinking for even a moment that it will be do once and done.  
Others will ask for tweaks, improvements, customization, features, etc.  
Once you get near pleasing the majority, some will think it is too complex and bloated and ask or a streamlined version.

![](https://global.discourse-cdn.com/meta/original/3X/4/c/4c799c0a69d5fc7afbdbd810bc06aa5b7ff932cb.gif)

Anyway, since my last post in this topic last summer, there have been some plugin-outlets added that could come in useful.

 ![](https://global.discourse-cdn.com/meta/original/3X/6/b/6b326c2fe8fb60fd2b41c0d87753ef972520700f.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/1/3/136f71ddbee1a598d4d8b664351ceb5388625d58.png)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [April 1, 2016, 4:50pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/9 "2016-04-01T16:50:50Z")

</div>

> [@thorbenegberts](#):
>
> no JS hack as mentioned above

I would not call [it](https://meta.discourse.org/t/link-custom-user-field-to-external-website/41218) “JS hack”. It uses Discourse Plugin API as explained here:

> [@Using the JS API](https://meta.discourse.org/t/using-the-pluginapi-in-site-customizations/41281):
>
> Discourse’s JavaScript API allows themes and plugins to make extensive customizations to the user experience. The simplest way to use it is to create a new theme from the admin panel, click “Edit Code”, and then head to the JS tab. For file-based themes, the API can be used by creating a file in the api-initializers directory. For theme’s that’s {theme}/javascripts/api-initializers/init-theme.gjs, and for plugins, it’s {plugin}/assets/javascripts/discourse/api-initializers/init-plugin.js. The c…

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [April 1, 2016, 5:20pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/10 "2016-04-01T17:20:11Z")

</div>

> [@techAPJ](#):
>
> I would not call it “JS hack”.

Sorry, I meant no offense. I’m new to Discourse and didn’t know that it’s not unusual to do [that](https://meta.discourse.org/t/link-custom-user-field-to-external-website/41218). I’ll look into it, too.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 1, 2016, 9:22pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/11 "2016-04-01T21:22:36Z")

</div>

I actually see displaying custom user fields on the user card as core. Core should simply have a checkbox in admin for this in the field config. (Ordering is a concern)

I think the best thing to do here first is post some screenshots of how config and info on card will look.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [April 2, 2016, 4:18am UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/12 "2016-04-02T04:18:34Z")

</div>

I’d also like to be able to enable showing the non-custom “Location” field on user cards.

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [April 2, 2016, 3:00pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/13 "2016-04-02T15:00:24Z")

</div>

Here are a few screenshots.

**Settings:**

 ![](https://global.discourse-cdn.com/meta/original/3X/4/e/4e7d455a18dcad2d7a3414b5a42df32bf72f72f3.png)

**User Card:**

 ![](https://global.discourse-cdn.com/meta/original/3X/b/e/bec716dcd5006bd2f5290e9a61de190ba6789da9.png)

Fields are placed beneath the “user-card-metadata” plugin outlet.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [April 2, 2016, 3:56pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/14 "2016-04-02T15:56:24Z")

</div>

Wondering whether the labels prefixing the values are really necessary.

Maybe just show “Software Developer” instead of “Job: Software Developer”?

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [April 2, 2016, 4:30pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/15 "2016-04-02T16:30:55Z")

</div>

I’m afraid that custom fields are not always self-explaining. But if I add a CSS class, you would be able to hide the tags via custom CSS. Would that be a good compromise?

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [April 2, 2016, 4:37pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/16 "2016-04-02T16:37:20Z")

</div>

That’d be fine with me… but I’d also question the kind of custom field that _isn’t_ self-describing, so it might be worth considering not showing them by default as a nudge in that direction. (eg, allow a CSS customization to _show_ the field)

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [April 2, 2016, 4:41pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/17 "2016-04-02T16:41:28Z")

</div>

At our company we display multiple IDs (that are only visible to our staff) to handle support requests of our webshop software’s customers. Like customer ID, system ID, system user ID. It would be very confusing not to know which number means what.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 2, 2016, 6:49pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/18 "2016-04-02T18:49:22Z")

</div>

So dislpay by default and people can hide the labels with CSS.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 4, 2016, 11:54pm UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/19 "2016-04-04T23:54:22Z")

</div>

I am not sure this is really the right location I think it should simply be an extra checkbox here:

 ![](https://global.discourse-cdn.com/meta/original/3X/c/4/c4a4a0770e24daa0a80ab1a8aef5676061e4a9ab.png)

`/admin/customize/user_fields`

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [April 8, 2016, 11:46am UTC](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662/20 "2016-04-08T11:46:53Z")

</div>

This okay?

 ![](https://global.discourse-cdn.com/meta/original/3X/5/f/5f1a0c4a76ebd48d06f7888c446fde6d9f699bc6.png)

[Next page](https://meta.discourse.org/t/custom-user-fields-on-usercard/22662.md?page=2)
