自定义用户卡片

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

1 个赞

要添加自定义字段,请从您站点的管理面板设置用户字段:自定义 > 用户字段

这将为用户在其偏好设置中创建一个字段,并且可以选择在用户卡片上显示该字段。

如果您想在用户卡片上隐藏信息,最简单的方法是向您站点的自定义主题添加自定义 CSS。

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 个赞

那里的链接现在是404了……我们今天应该看这里吗?:
app/assets/javascripts/discourse/app/components/user-card-contents.gjs

是的,你说得对!关于高级自定义的旧回复现在已经不太相关了……所以我将删除那部分。我们不再支持模板覆盖,因此您需要依赖 outlets 或 transformers,如 Developing Discourse Themes & Theme Components 中所述。

1 个赞

谢谢!只是试探一下——很高兴能避免走弯路。