Add a plugin based custom user field to the create account form?

AI-generated summary

davidnewkerk is seeking to add a plugin-based custom user field to the create account form in Discourse, as the standard UI-created fields use generic names like user_field_2, which are not suitable for their needs. While they’ve successfully implemented the field on the user profile edit page, they’re unsure how to display it during registration. merefield suggests using the custom wizard plugin, which allows for additional information collection during signup, and provides an example of using a custom field to let users set their national flag upon registration example.

I’ve added a custom user field using a plugin, following the example at:

This works great and the custom field appears on the user’s profile edit page, and the value can be edited and saved.

I’d like to get this field to appear as well on the create account form (app/assets/javascripts/discourse/templates/modal/create-account.hbs) the way that the UI-created custom user fields do, but am struggling to find a way to do it. If anyone knows how, or can point to any other plugins or examples that include a custom field on the registration form, that would be awesome!

Note: I’m aware that /admin/customize/user_fields allows the creation of custom user fields through the UI, however I discovered that the fields created in this way are internally given a generic name like user_field_2 (for example) and for my use case I need the field to have a predetermined permanent name that my plugin code can reliably refer to.

Thanks!

The Custom Wizard Plugin 🧙 allows you to prompt a user for additional information around registration. I recently employed that technique to allow users to set their National Flag when signing up which uses a Custom Field. National Flags - #81 by merefield