Change Page UI based on conditions in Experience cloud/community cloud salesforce?
In Salesforce, we can show the difference in page all pages base on audience criteria. It’s just like page visibility. Page variation and audience options will help us to do this.
How to create page variation and audience?
Let’s see everything with a perfect example.
In the below image, currently, I’m in builder options(For Home Page). Here our goal needs to show the different home page content based on the profile
- For System Admin Profile, We need to show a home page with Title : Welcome , Subtitle : Admin Home Page.
- For Other profiles we need to show Title : Welcome , Subtitle : Normal Home Page.
First, click the gear icon. It will trigger one popup screen.
Here click the new page variation button.
Click New Blank Page -> choose the layout based on your need -> Enter the name for the page variation (Here my page variation name is newHome)
In the above image, you can check the newly created page variation. so it’s time to add Title and subtitle for this page variation also now we need to set the audience for tha page. Click the audience icon as we mentioned in the image.
Create a new audience for the system admin profile.
STEP 4: Home page has default audience, it means all profile users can able to view the home page contents except system admin profile users. we have created a new variation right? newHome. It currently doesn’t have any audience that’s why it’s having none(marked in the below image) and also not published. let’s assign an audience for this variation so click assign.
Already we have created an audience for the system admin profile so just click assign
Finally, you can check both variations has an audience so just click the publish button and try to log in as a system admin profile user and some other profile user.
you can see the content difference on the portal screen 🙂