Liferay Content filtering by Using Custom Attribute

Liferay Content filtering by Using Custom Attribute

This post will help you to configure assets based on user’s custom attribute.

Scenario

Filter content based on user’s custom attribute. If user A logged in from India then asset publisher to display contents for India. If user B logged in from USA then asset publisher to display content from USA.

Step 1:

Create custom attribute for user with the type Text and name it as “Location”.

Step 2:

Set “India” to location user custom attribute for user A.

Set “USA” to location user custom attribute for user B.

Step 3:

Now navigate to global scope. From site menu move to global site.

Create vocabulary called “Location” in global scope. Create category “India” & “USA” inside Location vocabulary.

Step 4:

Create some web content or documents inside site (not global site) in which you want to configure asset publisher.

Categorize few of the contents in “India” category and few of them in “USA” category.

Step 5:

Now place asset publisher on page and click on configuration icon.

Specify “Location” in Displayed assets must match these custom user profile attributes.

That’s it. Now log in using different account and verify contents.

Leave a Reply

Your email address will not be published. Required fields are marked *