Hide certain information for anonymous user on header(XF) | Community
Skip to main content
Level 3
Mar 21, 2022 9:44 AM UTC
Solved

Hide certain information for anonymous user on header(XF)

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!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Mar 21, 2022 10:11 AM UTC

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

1 reply

arunpatidar
arunpatidarAccepted solution
New Participant
Mar 21, 2022 10:11 AM UTC

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:

Translate
Arun Patidar