nodebb-plugin-ns-custom-fields icon indicating copy to clipboard operation
nodebb-plugin-ns-custom-fields copied to clipboard

Question - Default key/type/name

Open Joykiller opened this issue 6 years ago • 1 comments

What would be the best method to insert a set of default keys and values for them also push/store them to all users including new ones when they join too?

Joykiller avatar May 18 '19 05:05 Joykiller

You could set custom fields to "default" values when a user is created - https://github.com/NodeBB/NodeBB/blob/b692dd87cd70b852ad619fd72358438d2805b2d8/src/user/create.js#L146 Action: action:user.create.

The overall idea with default values is a bit tricky. Custom Fields are considered as optional. The plugin is smart enough to skip custom fields which the user did not fill.

NicolasSiver avatar May 19 '19 11:05 NicolasSiver