- Only to be added via an editable template. Not intended to be added directly to a content page.
The User Menu component displays two items:
- The currently logged in user.
- Displays a cart indicating the number of assets a user has added to his/her cart.
In mobile/tablet breakpoints the rail disappears. When the rail is opened via the Header component a close icon appears that allows a user to close the rail.
The User Menu component should only be included via an editable template. It is not inteded to be added directly to a cq:Page. The User Menu component should always be in a locked state and only configurable via a template.
Policy Dialog / User Menu
Text to display in front of the user name.
Log In Label
Text to populate the Log In link.
Log In Page
Path to a cq:Page or URL for log in.
Log Out Label
Text to populate the Log Out link.
Log Out Page
Path to a cq:Page or URL to log out.
- Sling Models:
The User Menu will attempt to display the currently logged-in User’s profile picture. If none can be found a user icon is displayed.
Since v1.2.0 the user menu’s anonymous vs. authenticated state has moved to using client-side ContextHub logic that is cache-friendly.
An AJAX HTTP GET is made to
/libs/granite/security/currentuser.json?nocache=<time-in-ms> on page loads to retrieve the current user. This URI must be allowed via AEM Dispatcher.
Prior to v1.2.0
If caching pages for an authenticated user there is a potential issue in that User Menu component could be saved to the HTML cache. A feature like Sling Dynamic Include should be used for the above use case.