Hide certain information for anonymous user on header(XF) | Community
Skip to main content
Level 3
March 21, 2022
Solved

Hide certain information for anonymous user on header(XF)

  • March 21, 2022
  • 1 reply
  • 683 views

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.
Best answer by arunpatidar

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:

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 21, 2022

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