Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Show different content for anonymous and authenticated users

Avatar

Level 4

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.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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 

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

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 

Avatar

Community Advisor

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.

Avatar

Community Advisor

@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.