Expand my Community achievements bar.

SOLVED

custom workflow to be trigerred for all approvers when quickpublsh but rest should follow default workflow

Avatar

Level 3

Hello developers , I want to trigger custom workflow when approvers click on the quick publish button . but for the rest default workflow should be trigerred. It will be helpful if you can provide easy and efficient answer.

 

In general purpose how to make custom workflow to be trigerred when clik on the quick publish button.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

I think this question and answer go hand in hand with what you have already asked here: Do Not Show Quick Publish Button to Some Groups. There are two approaches you could take:

 

  1. Overlay the "Quick Publish" Button: You can modify the button's behavior to meet your expectations. This may be more challenging if you're not comfortable working with overlays, JavaScript, and JSP.

  2. Create an Extra Button: You could add an additional button, perhaps named "Quick Publish" or something similar, that triggers the custom workflow. As I explained in the other thread, you can then hide or show the buttons using granite:renderconditions based on the logged-in user.

You can check that thread for examples, but overall, the customization you're looking for will require some work. You may not find a complete coded solution elsewhere, but you will find references and guidance to help you build what you need.

 

Here are extra references:

https://experienceleague.adobe.com/en/docs/experience-manager-guides/using/install-guide/on-prem-ig/... 

https://techrevel.blog/2018/02/09/customizing-aem-assets-toolbar/ 

 

Hope this helps!



Esteban Bustamante

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

I think this question and answer go hand in hand with what you have already asked here: Do Not Show Quick Publish Button to Some Groups. There are two approaches you could take:

 

  1. Overlay the "Quick Publish" Button: You can modify the button's behavior to meet your expectations. This may be more challenging if you're not comfortable working with overlays, JavaScript, and JSP.

  2. Create an Extra Button: You could add an additional button, perhaps named "Quick Publish" or something similar, that triggers the custom workflow. As I explained in the other thread, you can then hide or show the buttons using granite:renderconditions based on the logged-in user.

You can check that thread for examples, but overall, the customization you're looking for will require some work. You may not find a complete coded solution elsewhere, but you will find references and guidance to help you build what you need.

 

Here are extra references:

https://experienceleague.adobe.com/en/docs/experience-manager-guides/using/install-guide/on-prem-ig/... 

https://techrevel.blog/2018/02/09/customizing-aem-assets-toolbar/ 

 

Hope this helps!



Esteban Bustamante

Avatar

Community Advisor

you can try or test like this:

Get the quick publish button id and write a event listener using javascript function:

 

$(document).on("click", ".cq-siteadmin-admin-actions-quickpublish-activator", function(e) {
e.preventDefault();
var selectedPages = Granite.author.selection.getSelectedPages();
if (selectedPages.length > 0) {
triggerCustomWorkflow(pagePath);
}

});

 

===

function triggerCustomWorkflow(pagePath) {
$.ajax({
type: "POST",
url: "/bin/startCustomWorkflow",
data: {
pagePath: pagePath
},
success: function() {
console.log("Custom workflow triggered successfully.");
},
error: function() {
console.log("Failed to trigger custom workflow.");
}
});
}

 

Screen Shot 2024-10-18 at 10.45.08 AM.png