I am new to modx revo and trying to add extra fields in user creation from backend. Which file should i check out for customization. I added the custom field in backend with this code on modx.panel.user.js
file.
{
id: 'modx-user-companyname'
,name: 'company_name'
,fieldLabel: _('company_name')
,xtype: 'textfield'
,anchor: '100%'
,maxLength: 255
}
I created custom column named company_name
in database table modx_users
but I don't know how to save it on database. Any ideas?
Editing the core code of modx is considered a bad idea.
Really you have two options if you want to add extra properties to users...
Firstly you could take advantage of modUser
extended
field which allows you to store extra properties for the user and are stored as JSON. This is available in the default ui in the manager.
See Understanding MODX Extended User Fields and JSON
Secondly, you could extend modUser
. This would give you full control over the user model and could then add additional related entities. From then, you might be able to alter the user form in the manager with form customisation or write a plugin to alter view.