Looking for the best approach to update workflow modal label for a specific workflow not for all
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
@Nilesh_Mali, there is a workaround that I could implement for one of my requirement,
Created a "cq:ClientLibraryFolder" folder under components in ui.apps.
Set categories as below
categories="[coralui3,coralui2]"
and in the js.txt, add a new file with below code
(function(document, $) {
'use strict';
$(document).on('foundation-contentloaded', function(e) {
var selection = $(".foundation-collection-item.foundation-selections-item.is-selected");
if (selection !== null) {
var itemPath = selection.data("foundationCollectionItemId");
if (itemPath === '/var/workflow/models/YOUR-WORKFLOW-MODEL') {
$("input[name='model']").closest('form').find($("textarea[name='startComment']").prev('label')).html('TEXT-TO-REPLACE');
}
}
});
})(document, Granite.$);
Here, itemPath is your Workflow model path in case you want the changes to be specific to a particular WorkFlow.
Hope this workaround works for you!
Hi @Nilesh_Mali
You want to change the "comment" label to something else for a particular WF?
Is this your query?
Yes. I want to change the "comment" label to something else for a particular WF.
Hi @Nilesh_Mali
We cannot overlay these nodes and hence won't be able to customize it.
Hope it helps.
Hi @Nilesh_Mali ,
I am not sure how to customize this for a specific model although this value is coming from "/libs/cq/workflow/admin/console/content/models/runmodeldialog/items/form/items/startComment".
You can try adding a new button to the Workflow console for your custom requirement.
Below article demonstrates how you can do it for Sites console. You can follow similar steps and do it for Workflow models view instead.
e.g. target should be ".cq-workflow-admin-models" instead of ".cq-siteadmin-admin-childpages"
Thanks,
Ram
@Nilesh_Mali Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
@Nilesh_Mali, there is a workaround that I could implement for one of my requirement,
Created a "cq:ClientLibraryFolder" folder under components in ui.apps.
Set categories as below
categories="[coralui3,coralui2]"
and in the js.txt, add a new file with below code
(function(document, $) {
'use strict';
$(document).on('foundation-contentloaded', function(e) {
var selection = $(".foundation-collection-item.foundation-selections-item.is-selected");
if (selection !== null) {
var itemPath = selection.data("foundationCollectionItemId");
if (itemPath === '/var/workflow/models/YOUR-WORKFLOW-MODEL') {
$("input[name='model']").closest('form').find($("textarea[name='startComment']").prev('label')).html('TEXT-TO-REPLACE');
}
}
});
})(document, Granite.$);
Here, itemPath is your Workflow model path in case you want the changes to be specific to a particular WorkFlow.
Hope this workaround works for you!
Its working as expected.
Thank you @Avdhesh-Pandey !!
Views
Likes
Replies