Expand my Community achievements bar.

SOLVED

Custom script for AEM inbox notification

Avatar

Level 2

Hi Everyone,

    I have one requirement, whenever user login or lands aem start page in aem 6.5 environment after that aem inbox notification automatically should expand. I have written a custom script but I don't know where to place this since these are all granite and coral related functionalities.

 

Script:

document.addEventListener('DOMContentLoaded', function() {
if (window.location.pathname === '/aem/start.html') {
var aemInboxNotification = document.querySelector('.granite-shell-badge');
if (aemInboxNotification) {
aemInboxNotification.click();
}
}
})

 

 

Can anyone help me on this? Thanks in advance!

jooca_0-1736311056563.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @jooca 

 

You can check n/w tab which clientlibs are loading as part of the home screen.

 

coralui3 categories will load by default on the AEM screen from foundation granite clientlibs

You can create your own custom clientlib files (Ex : /apps/project/custom-clientlibs ) in your project and use same category 

 

PRATHYUSHA_VP_0-1736315526639.png

Hope this helps

 

Thanks

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @jooca 

 

You can check n/w tab which clientlibs are loading as part of the home screen.

 

coralui3 categories will load by default on the AEM screen from foundation granite clientlibs

You can create your own custom clientlib files (Ex : /apps/project/custom-clientlibs ) in your project and use same category 

 

PRATHYUSHA_VP_0-1736315526639.png

Hope this helps

 

Thanks

Avatar

Community Advisor

Hi @jooca 

To trigger the auto-expand of AEM Inbox Notification on the start page, you can place your custom script in a ClientLib under the CQ author or publish environment.

Steps:

  1. Create a ClientLib in /apps/<your_project>/clientlibs/ (e.g., clientlibs/inbox-notification).
  2. Add the JavaScript file (e.g., inboxNotification.js) with your script inside clientlibs/inbox-notification/js/.
  3. Include the ClientLib in your start.html or AEM page template by adding the following in the head section: