How to display web contents for segmented users and for all users in a single Asset Publisher
Written By
Daniel Mijarra
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- Sometimes it is required to display web contents for segmented users and, at the same time, display web contents for all users (segmented or not).
- For example, we may want to show different web contents for users belonging to different areas such as cities, departments, etc. and, at the same time, we want to show public web contents to all users, such as regional news, corporate communications, etc.
- How can we achieve it? Can we do it in a single Asset Publisher?
Resolution
- We can do it using Segments, one Collection and one Asset Publisher.
- This is an example of how to do it:
- Create user segments (Seg1, Seg2, etc), according to your needs.
- Create a Dynamic Collecion Coll1:
- In the Coll1 collection, configure:
- For Anyone:
- Item type: Web Content Article.
- Item subtype: Basic Web Content.
- Add a filter: Contains All of the following Tags >
For everyone
- Press Save.
- Add a Personalized Variation for each segment created (Seg1, Seg2, etc) in the Coll1 collection.
- For each Variation, configure:
- Item type: Web Content Article.
- Item subtype: Basic Web Content.
- Add a filter: Contains Any of the following Tags:
For everyone For Seg1.
The second tag, For Seg1, must be set according to the segment in which each variation has been created:
- For Segment Variation Seg1, set
For Seg1 tag.
- For segment Variation Seg2, set
For Seg2 tag.
- Etc...
- Press Save.
- Create the web content as follows:
- Content to be shown to all users:
Add only the For everyone tag.
- Content to be shown only to a segment of users:
Add the tag that corresponds to the user segment, For Seg1 or For Seg2, etc (only one), to each web content.
- Add an Asset Publisher to a page and configure:
- Asset selection: Collection > Coll1.
Did this article resolve your issue ?