Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Hide certain information for anonymous user on header(XF)

Avatar

Level 4

Dear community,

 

I'm new to AEM and try to build my first site. My question is:

I'd like to put icon / navigation bar/ user info, these three components on my header (made by experience fragment)

but for the anonymous users, I'd like to hide the navibar and user info components (since the user is anonymous).

 

Have checked the properties and some other items shown on my AEM instance but still have no idea what should I do next... or maybe I cannot get what I want with using experience fragment?

 

Any advices are most welcome, thanks in advance!

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi 

you can check the user status from the request.

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SimpleGetGroup.java

If user is anonymous then you can hide or return a flag from sling modal to HTL:



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi 

you can check the user status from the request.

https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SimpleGetGroup.java

If user is anonymous then you can hide or return a flag from sling modal to HTL:



Arun Patidar