Kentico CMS 7.0 Developer's Guide

Enabling visibility controls

Enabling visibility controls

Previous topic Next topic Mail us feedback on this topic!  

Enabling visibility controls

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The visibility selection drop-down list can be added to any field of the user's profile, not just the e-mail field shown in the example in the How it works topic. This can be changed in Site Manager -> Development -> System tables. Choose to Edit (Edit) the User (CMS_User) system table and switch to the Alternative forms tab.


If you are not familiar with the Alternative forms concept, please read the Module Alternative forms chapter first.


The User system table represents the database table that stores information about registered users. Each of the four alternative forms that you see in the list is used in a specific situation when the system accesses the table:


Registration form - when registering a new user using the Custom registration form web part.

Display profile - when displaying a user's public profile using the User public profile web part.

Edit profile - when editing a user's profile using the My account web part.

Edit profile (MyDesk) - when editing the user profile in CMS Desk -> My Desk -> Account -> Details.


The visibility field can be set in each of these forms.




Let's assume that we want the Full name field to be optionally hidden in the public profiles of users, based on the configuration made in the profile editing section of each specific user.


1. Edit (Edit) the Edit profile (Community) alternative form, which is the form that is used by the My profile web part on the Community site. Switch to the Fields tab and select FullName from the list on the left. Select Visibility (radio buttons - horizontal) from the Visibility control drop-down. Check the Allow user to change field visibility checkbox and finally click Save Save.




2. Switch to the Layout tab. We will need to create another line in the table and add the visibility control into it.


Place the cursor into the FullName line (where the $$label:FullName$$ value is). Right click and choose Row -> Insert Row After from the context menu. Into the first column of the new row, enter: Display my full name to:


Now we will add the visibility control itself. Place the cursor into the second column, select FullName from the Available fields list and click the Insert visibility control button. The result should look as in the screenshot below.


When you are finished, click Save Save.




3. Switch to CMS Desk and select the Members -> Management document in the content tree. Open the Design tab and Configure (Configure) the MyAccount web part. Make sure that the Allow user to edit field visibility property is checked and click OK.




4. Now sign out of the administration interface and sign in to the website as David with a blank password. Click the Edit my profile link in the right Shortcuts menu. You should see a set of radio buttons below the Full name field, which allow users to determine the visibility of their full name.