Login supports setting custom (or, "Extended") fields using Revolution's User Profile "extended" field. Basically, MODx stores the field data in a JSON object, which can be retrieved at any time.
Basically, to start using extended fields, all you have to do is add a form field to your Register and UpdateProfile forms. That's it. The snippets will automatically then check for any fields in the POST that aren't in the User table, and if found, store them as extended (custom) fields. They will then be expanded when using the Profile snippet. For example, a Register form that has this in it:
will automatically store the "color" field in the extended fields data. You can even use validators, such as :required as shown here, on the custom field in your Register snippet.
|Login won't store the field named in the &submitVar property. In this example, "go" wont be stored because it's passed in the &submitVar property.|
Then, you can use Profile to display this data somewhere on a page:
Or even when using the UpdateProfile snippet:
Simple as that!
Both the Register and UpdateProfile snippets have a property called "excludeExtended" that takes a comma-separated list of field names to exclude from being saved as extended fields. So, say you had fields named 'nospam' and 'customProp', that you didn't want to be saved as custom fields in Register. You'd simply call Register like so:
Extended fields can also be edited and added from within the Manager, by editing the User and clicking on the "Extended Fields" tab. Make sure if you add fields there, though, that you add them to your UpdateProfile and/or Register forms.
Also, if you have an extended field in a container, such as in this example, where you have test -> boo:
You can access them with the . syntax:
...will display 'boo!' there.