Custom User fields on Usercard


(Thorben Egberts) #7

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?


(Mittineague) #8

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.


(Arpit Jalan) #9

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


(Thorben Egberts) #10

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.


(Sam Saffron) #11

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.


(Dave McClure) #12

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


(Thorben Egberts) #13

Here are a few screenshots.

Settings:

User Card:

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


Discourse Development Contribution Guidelines
(Dave McClure) #14

Wondering whether the labels prefixing the values are really necessary.

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


(Thorben Egberts) #15

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?


(Dave McClure) #16

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)


(Thorben Egberts) #17

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.


(Rafael dos Santos Silva) #18

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


(Sam Saffron) #19

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

/admin/customize/user_fields


(Thorben Egberts) #20

This okay?


(Sam Saffron) #21

Perfect, a pr for this is welcome


(Thorben Egberts) #22

Here’s my pull request:


What are user cards?
(Dave McClure) #23

Awesome! Looking forward to this…

Showing the existing location field on the user card, is still on my wish list… I don’t think that’s been done yet, has it?

I’ll take a look at what that involves unless someone beats me to it.


#24

I am looking for the same thing, location, along with a custom field.


(Dave McClure) #25

(Erlend Sogge Heggen) #26