Show different content for anonymous and authenticated users | Community
Skip to main content
arturl43391132
Level 4
October 18, 2021
Solved

Show different content for anonymous and authenticated users

  • October 18, 2021
  • 4 replies
  • 1103 views

Hello AEM Community,

 

AEM - 6.5

 

Could you please share ideas / best practises how to implement the following solution on AEM pages:

 

We need a component with 2 parsyses - "preview content" and "exclusive content".

 

"preview content" should be visible for all users.

"exclusive content" should be hidden from anonymous users and instead of it they should see "sign-in" form. And authenticated users should see exclusive content fully.

 

Users are not associated with aem, but with another service where they are registered and stored.

 

Thanks.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Siva_Sogalapalli

You may try to achieve this by using experience fragments and context Hub, please check below and see if that helps incase if you've not seen this. 

https://helpx.adobe.com/experience-manager/using/contexthub_personal_exfragments.html 

4 replies

Siva_Sogalapalli
Community Advisor
Siva_SogalapalliCommunity AdvisorAccepted solution
Community Advisor
October 18, 2021

You may try to achieve this by using experience fragments and context Hub, please check below and see if that helps incase if you've not seen this. 

https://helpx.adobe.com/experience-manager/using/contexthub_personal_exfragments.html 

Ankur_Khare
Community Advisor
Community Advisor
October 18, 2021

For exclusive content you can have following. logic-

Assuming once user is logged will have cookies or something which you must be getting unique to the logged in user, check that particular stuff and accordingly show the form div or the content div for logged in users.

Sanjay_Bangar
Community Advisor
Community Advisor
October 18, 2021
Bhuwan_B
Community Advisor
Community Advisor
October 18, 2021

@arturl43391132 As @siva_sogalapalli  rightly pointed, try acheiving this usecase using experience fragments and contextHub(You can use Adobe Target inplace of contextHub if your Organization have it), Use cookie/localstorage to differentiate between authenticated/anonymous user.