Creating Custom User Profiles

User profile support is enabled when an account has the Membership feature enabled, which is available to sites using our Plus and Premium plans.

All user profiles have certain base fields that are built-in:

Field name Note
name Full name of user
first_name The first name of the user
last_name The last name of user
email The email address and login identity of the user
role A comma separated list of roles that are assigned to the user
activated “true” or “false” depending on whether user activated her account
password Stored in encrypted form, so it cannot be accessed programmatically

You can add as many fields as you'd like to the profile. This is very similar to creating any other Webvanta custom item type.

Customizing the User Profile

To set up user profiles, click the People tab, and then click Customize User Profile Definition option in the Membership Customization section of the page. (If you don't see that section on the main People page, then the membership features are not enable for your site. Please create a ticket to request an upgrade.)

You'll then see the Edit User Profile Definition screen. Click the Add Custom Field button for each field that you want to add. Note that the standard fields (name, email, password, activation status, and roles) are always present and are not shown on this screen. The first_name and last_name fields are handled specially, and while they show up, they are not editable. The field types that you can use are text field, text area, taxonomy, date, related items, related assets, and checkbox (boolean).

User Controls

You'll typically want to provide an "Edit Profile" link in the footer of your site. The URL for this is /admin/profiles/edit_my_profile. You may also want to provide Log Out (/logout) and Log In (/login) links.

Members who are not admins do not have any access to the site's control panel, except for an extremely minimal control panel with a single tab, “Profile”. This allows them to edit their profile information.

The Edit User Profile page is a special kind of control panel page that supports basic customization. It is styled as a Webvanta admin page to start, but without the tool bar, navigation, or footer present. The order and layout of the fields is automatic, and all fields must be included. However, you have the ability to inject custom CSS and JavaScript into the head section of this page. Specify a link and/or a script tag in the System Config called “admin.custom.control_panel.head_markup”. Your CSS will be placed at the end of the head section of the page. Likewise, you can use JavaScript to manipulate the DOM in any fashion you wish. Do note that you must not change the form or input elements beyond position or classes. The provided names and IDs are critical to the proper operation of the form.

The Edit User Profile has two form buttons present. Both will automatically bring the user back to the referring page. If you would like to change this default to a specific page, set an optional URL in the associated System Configs: “admin.custom.control_panel.profile_cancel_url” and “admin.custom.control_panel.profile_save_url”. You can also dynamically change the destination by altering the hidden form field return_to with JavaScript that you inject into the page.

Note: Admins have full access to edit any user’s profile, while members, of course, have access only to their own.