custom workflow to be trigerred for all approvers when quickpublsh but rest should follow default workflow | Community
Skip to main content
Level 3
October 18, 2024
Solved

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

  • October 18, 2024
  • 2 replies
  • 576 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

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/web-editor-configs/conf-web-editor-customize-toolbar 

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

 

Hope this helps!

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
October 18, 2024

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/web-editor-configs/conf-web-editor-customize-toolbar 

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

 

Hope this helps!

Esteban Bustamante
SureshDhulipudi
Community Advisor
Community Advisor
October 18, 2024

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.");
}
});
}