Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Hide certain information for anonymous user on header(XF)

Avatar

Level 3

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:

View solution in original post

0 Replies

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: