Allowing users to change the information they share

You can give users the option of changing the visibility of fields in their user profiles. This way, users can choose which information they share with others in the system.

Allowing users to choose visibility options of fields

Enabling field visibility control for form fields

You can add visibility selectors to any user profile fields:

If you are not familiar with the concept of alternative forms, see Creating alternative forms for more information.

  1. Open the Modules application.
  2. Edit the Membership module.
  3. Open the Classes tab.
  4. Edit the User (cms.user) class.
  5. Switch to the Alternative forms tab.

The alternative forms of the User class represent various types of forms that the system uses to display and edit the data of user accounts. You can add visibility control for any of the forms.

For example, the following steps describe how to allow users to hide the Full name field in public profiles:

  1. Edit the Edit profile alternative form.
  2. Open the Fields tab.
  3. Select the FullName field in the list.
  4. Enable the Allow user to change field visibility option.
  5. Choose Visibility (radio buttons - horizontal) as the field’s Visibility control.
  6. Click Save.

Editing the field visibility settings of a field

You also need to insert the visibility control into the form’s layout:

  1. Switch to the Layout tab of the alternative form editing interface.
  2. If you are editing one of the default alternative forms, click Customize.
  3. Select Use custom form layout.
  4. Click Generate default layout. A default table layout appears in the editor.
  5. Place the cursor into the desired location for the visibility control.
  6. Select Visibility control as the Layout element and the associated form field (for example FullName).
  7. Click Insert.
  8. Click Save when you are done editing the form layout.

Adding visibility control into the layout of a form

Allowing field visibility control in web parts

Forms are displayed on websites by adding web parts onto pages. To allow users to control visibility of form fields, you need to prepare an appropriate alternative form and configure the properties of the web parts according to the following information:

User public profile

  • Form name - specifies the full name of the desired alternative form (cms.user.DisplayProfile by default).
  • Apply visibility settings - check to enable visibility control.
  • Use visibility settings from form - selects the form whose visibility settings the web part uses (if empty, the form specified by Form name property is used).

Custom registration form

  • Alternative form - specify the full name of the desired alternative form (cms.user.RegistrationForm by default).

My account

  • Form name - specify the full name of the desired alternative form (cms.user.EditProfile by default).
  • Allow user to edit field visibility - check to enable visibility control.

For example, to add visibility control to the account page on the sample Corporate site:

  1. Open the Pages application.
  2. Select the Special pages/User/My Account page in the content tree.
  3. Open the Design tab and Configure the My account web part.
  4. Make sure that the correct alternative form is assigned in the Form name property (cms.user.EditProfile for the Edit profile form modified in the example above).
  5. Enable the Allow user to edit field visibility property.
  6. Click OK.

If you log in on the live site and open the My account page, you can see the visibility controls for fields in the profile editing form.

Setting the visibility of a field on the live site