This theme component allows to show a user field form in any Discourse post. Changes made in the form will be saved in the current user profile. It’s useful to ask users to make change to a user field without having to force them to search the field in their profile.

Usage for a user field named age and another one named best fruits:

[wrap=user-field names="age,best fruits"][/wrap]

Install this theme component


Excellent addition. Thank you. @joffreyjaffeux


Ok it does work for me:

[wrap=user-field names="Job Title,Employer"][/wrap]

Two things:

  • first I added some debugging in the code, so if you pull the latest version of the theme, and open the console while looking at a code, if it can’t find a field it should show something like this:
Couldn’t find "Foo" in user fields: "Job Title", "Employer"
  • be sure to do a hard refresh of your page or the user fields won’t be available on the front. One thing you can do to be sure they are loaded is to open the console and look at the result from: Discourse.Site.currentProp("user_fields")