自定义用户卡片

Is it somehow possible to customize the information / fields on a user card?

1 个赞

To add a custom field, from your site’s admin panel you can setup a user field: customize > user fields

This will create a field for a user to fill out in their preferences, and it can optionally be shown on the user card.

If you’re looking to hide information on the user card, the easiest way is by adding custom CSS to your site’s theme.

6 个赞

Thank you very much.

Another, similar question: is there a way to hide the user statistics at the user profile page?

1 个赞

Yes, any element you see on the screen can be targetted and hidden via CSS rules in Admin, Customize.

1 个赞

The link there is now a 404… is this where we’d be looking today?:
app/assets/javascripts/discourse/app/components/user-card-contents.gjs

Yes that’s accurate! that old reply about advanced customization isn’t really relevant anymore… so I’m going to remove that part. We no longer support template overrides, so you’ll want to rely on outlets or transformers as mentioned in Developing Discourse Themes & Theme Components

1 个赞

Thank you! Was just dipping a toe – glad to avoid any wrong turns.