Displaying personalized content

Kentico CMS allows you to personalize the displayed content based on the current user.

 

 

 

Personalization in short

 

1. If you want to customize the content displayed to the users, you need to grant or deny the READ permission to these users and turn on the Check permissions attribute of the appropriate web parts.

 

2. When the user is not authenticated, the system uses a special user Anonymous User (public).

 

Example: Personalizing the Products menu

 

In the previous chapter, we have configured secured area for the Products section of the web site. In this example, you will learn how to display the Products section only to members of the Customers and Partners roles and how to display the PDAs category only to the members of the Partners role.

 

1.Sign in to CMS Desk as administrator.
 
2.Go to Administration -> Roles and create new roles Customers and Partners.
 
3.Go to Administration -> Users and create a new user Customer1 with following values:
- User name: Customer1
- Full name: Testing Customer
- Enabled: true
- Is editor: no
Click OK.
Go to the Roles tab in the User properties dialog and add the user to the Customers role.
 
4.Create another user Partner1 with following values:
- User name: Partner1
- Full name: Testing Partner
- Enabled: true
- Is editor: no
Click OK.
Go to the Roles tab in the User properties dialog and add the user to the Partners role.
 
5.Go to Content and click the root. Click Properties -> Security.
 
6.First, we need to grant the Anonymous user (public) and Customers and Partners roles with Read permission for the whole web site. Click Add, click Search, select Anonymous user (public), Customers and Partners and click OK.
 
clip0538
 
7.Now grant all newly added users/roles with Read permission. You need to click each user/role, check the box next to Read and click OK.
 
clip0539
 
8.Now we hide the product categories from public users. In the content tree, click /Products/Cell Phones. Click Properties -> Security, choose the Anonymous User and deny the Read permission. Click OK. Repeat the same for categories Laptops and PDAs.
 
9.Now we will hide the PDAs category from the Customers role members. Display the Security dialog for the /Products/PDAs document and deny the Read permission to the Customers role. Click OK.
 
10.The permissions are not checked by web parts by default, so we need to configure the web parts so that they check the Read permission of the current user. Choose the root in the content tree and click the Design tab. Configure the cmsmenu web part and set its property Check permissions to true (checked). Click OK. Repeat the same for the LeftTreeMenu and ProductDataList web parts on the /Products page.
 
11.Sign out. If you mouse-over the Products menu item, you will see that the sub-categories are no longer displayed.
 
12.Click Products and sign in as user Customer1. You will see a page like the one below. As you can see, the PDAs section and PDA products are not displayed to this user.
 
clip0541
 
13.Now sign out and sign in again as user Partner1.You will all categories and products:
 
clip0540
 

You have learned how to personalize the content displayed to users based on their permissions.