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.
Solved! Go to Solution.
Views
Replies
Total Likes
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:
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.
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://techrevel.blog/2018/02/09/customizing-aem-assets-toolbar/
Hope this helps!
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:
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.
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://techrevel.blog/2018/02/09/customizing-aem-assets-toolbar/
Hope this helps!
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.");
}
});
}
Views
Likes
Replies
Views
Likes
Replies