Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Want to update participant title dynamically

Avatar

Level 3

Hi Community

 

I have a requirement where i want to show page path in the title for participant step workitem at http://localhost:4502//mnt/overlay/cq/inbox/content/inbox.html

As shown in below image i want to update this title dynamically

wrok.jpg

4 Replies

Avatar

Community Advisor

Hello @adivj95  - 

 

You may do so (as drafted below), but it might have certain implications which you have to additionally handle/consider : 

  • With the latest upgrades/versioning, you might have to revisit the implementation done to handle the above use-case.
  • With the customization required to modify the title of the inbox notification for the Workflow participant step, remember all notification to the inbox shall get affected unless explicitly handled.

If you are looking for a sample script/approach to handle this use-case : 

  • You can create a client-side JavaScript file, for example, customTitle.js, and place it in your AEM project's client-side code folder. 

 

// Wait for the DOM to be ready
document.addEventListener("DOMContentLoaded", function() {
  // Write the code to get the page, as you have not mentioned which page path you want to update.
  var pagePath = <script>;
  
  // Update the document title with the page path
  document.title = "Page Path: " + pagePath;
});
​

 

  • Include it on the inbox.html page (Make sure you overlay it at /apps, before updating). You can do this by adding the following line inside the <head> section of the inbox.html file:

 

<script src="/path/to/your/customTitle.js"></script>

 

 

Thanks,

Tanika

Avatar

Level 3

for inbox page it will work but when i click on notification icon i will see the title without page path

Avatar

Community Advisor

Hello @adivj95 

 

It might be cleaner if you use Description section to add payload Information. The title will help easily identify type of task, while description will provide path to asset

 

aanchalsikka_0-1689162575088.png

 

The API details are available here https://github.com/arunpatidar02/aem63app-repo/blob/master/java/SimpleCreateTaskServlet.java

 


Aanchal Sikka

Avatar

Level 3

@aanchal-sikka the code in the given github link can be used for creating custom notification, but i want to update the default workflow participant notification, which we get whenever we user participant step in workflow , is there any utility to update that ?