Custom User fields on Usercard

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.

14 Likes

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?

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

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) ?

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

7 Likes

This can now be done via:

5 Likes

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 :slight_smile: ).

@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…

…with captions:

  • public custom fields on user card
  • staff user custom fields on user card

(open to improvements :slight_smile: )

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?

3 Likes

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.

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

6 Likes

I would not call it “JS hack”. It uses Discourse Plugin API as explained here:

2 Likes

Sorry, I meant no offense. I’m new to Discourse and didn’t know that it’s not unusual to do that. I’ll look into it, too.

2 Likes

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.

11 Likes

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

3 Likes

Here are a few screenshots.

Settings:

User Card:

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

3 Likes

Wondering whether the labels prefixing the values are really necessary.

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

1 Like

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?

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)

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.

3 Likes

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

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

/admin/customize/user_fields

10 Likes

This okay?

8 Likes