Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Want to add link to content in participant workitem notification

Avatar

Level 3

Hi Community

 

I want to add a link to content when participant got the workflow notification and open to view the work-item, as shown in below image i want link to the content,where i can click and it takes me to content in edit mode

scs.jpg

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@adivj95 ,

Everything under /libs/cq/inbox/content/inbox is defined as jcr:mixinTypes = "granite:InternalArea", meaning these nodes should not be overlaid, inherited or used directly.

https://experienceleague.adobe.com/docs/experience-manager-65/deploying/upgrading/sustainable-upgrad...

 

This also implies that workitem menu or content page should not be modified.

 

Having said that, assuming if this nodes are not marked as granite:InternalArea, the below steps should help you out to create direct link to payload item from workitem page:

1) Overlay /libs/cq/inbox/content/inbox/details/workitem/jcr:content/actions to /apps and add a new node called "viewpayloadItem" with following properties:

Sudheer_Sundalam1_1-1689260990488.png

 

This should show a new view payload action button on the action bar:

Sudheer_Sundalam1_2-1689261086855.png

Then add this simple jquery script in a new author clientlib and making sure it is loading on the workitem page:

$( document ).ready(function() {
    $(".inbox-details-workitem-action--payload").on("click", function name(params) {
        var url = "/editor.html" + $(".foundation-layout-panel-body input[name=contentPath]").val() + ".html";
        window.open(url, '_blank');
    });
});


You may further improve this script by checking type of workflow payload item. If the payload item is a page then, prepend "/editor.html" or if the payload item is a DAM asset, then preprend "/assetdetails.html".

Just a thought.

 

 

View solution in original post

3 Replies

Avatar

Community Advisor

@adivj95 ,

 

From the inbox window for the workflow user/approver, you can view the workflow payload in the edit mode using the "Payload" button. Please see the screenshot below.

 

Sudheer_Sundalam1_0-1689096001409.png

 

Avatar

Level 3

But i want to add link on workitem page as shown in screenshot

is it possible??

Avatar

Correct answer by
Community Advisor

@adivj95 ,

Everything under /libs/cq/inbox/content/inbox is defined as jcr:mixinTypes = "granite:InternalArea", meaning these nodes should not be overlaid, inherited or used directly.

https://experienceleague.adobe.com/docs/experience-manager-65/deploying/upgrading/sustainable-upgrad...

 

This also implies that workitem menu or content page should not be modified.

 

Having said that, assuming if this nodes are not marked as granite:InternalArea, the below steps should help you out to create direct link to payload item from workitem page:

1) Overlay /libs/cq/inbox/content/inbox/details/workitem/jcr:content/actions to /apps and add a new node called "viewpayloadItem" with following properties:

Sudheer_Sundalam1_1-1689260990488.png

 

This should show a new view payload action button on the action bar:

Sudheer_Sundalam1_2-1689261086855.png

Then add this simple jquery script in a new author clientlib and making sure it is loading on the workitem page:

$( document ).ready(function() {
    $(".inbox-details-workitem-action--payload").on("click", function name(params) {
        var url = "/editor.html" + $(".foundation-layout-panel-body input[name=contentPath]").val() + ".html";
        window.open(url, '_blank');
    });
});


You may further improve this script by checking type of workflow payload item. If the payload item is a page then, prepend "/editor.html" or if the payload item is a DAM asset, then preprend "/assetdetails.html".

Just a thought.