Add custom user attribute using plugin

Plugin Development
  • Hi Team NodeBB,

    I am trying to create plugin to add one set image/icon field in the user setting page (user/username/settings) and this value display after user name in topic list page.

    var Plugin = {};
    
    console.log('outside - called properly');
    
    Plugin.addCustomFields = function(hookData, callback) {
    
      console.log('Custom Field function is called properly');
       // Add your custom fields to the `fields` object here
    
       hookData.custom_field_1 = {
          type: 'text',
          required: true,
          title: 'Custom Field 1'
       };
    
    };
    
    module.exports = Plugin;
    

    could you please guide me which method i need to use and for image/icon field how to write filed attribute?


Suggested Topics