Hi Team,
When author activates the asset, and the effective publish date is not reached, a popup will display.
So here, we have an option in metadata of an asset is "effective date" it is a date field.
Now the requirement if we publish the asset only when it reach effective dates, it we try to publish asset before effective date then it'll show a pop-up,
Asset will not be published until effective date is reached.."
Give option to Cancel or Proceed with in Pop-up. Proceed will activate the asset.
Not sure how to do this, we need to write a JS, but which OOTB JS we need to overlay for asset metadata, or how to do this?
Note : here "Effective dates" is a custom date field in metadaschema.
Scenario : Suppose, if author set Effective date as 30-Dec-2020 and want to activate the asset before mention effective date 30-Dec-2020, then instead of publishing it'll show the pop-up
"Asset will not be published until effective date is reached.."
Give option to Cancel or Proceed with in Pop-up. Proceed will activate the asset.
@arunpatidar @Vijayalakshmi_S @kautuk_sahni @Theo_Pendle @Nikhil-Kumar
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
OOB Default Metadata Schema doesn't has this field named "Effective Dates". (Per 6.5.0)
Is it a custom field you have as part of your project specific schema?
OOB Default Metadata Schema doesn't has this field named "Effective Dates". (Per 6.5.0)
Is it a custom field you have as part of your project specific schema?
Yes Effective Dates is a custom field and example is author set effective date as 15-sept-2020 and if want to publish before 15-sept-2020 then it'll not publish the asset instead will show the pop-up
Updated the same in above question, thank you
Views
Replies
Total Likes
Views
Replies
Total Likes
Below mentioned details are per AEM 6.5.0
JS responsible for Quick Publish :
JS for Manage Publication :
Steps for Overlay:
Code responsible for pop up:
var ui = $(window).adaptTo("foundation-ui");
ui.prompt("Asset Quick Publish", message.html(), "notice", [{
text: "CANCEL"
}, {
text: "PUBLISH",
primary: true,
handler: function() {
replicateToPublish(activator);
}
}]);
foundation-ui JS component's prompt is responsible for pop up
Logic related to asset's Effective date:
You can introduce above prompt snippet within the desired effective date condition. (Selected asset path can be accessed as below)
var $collection = $(".cq-damadmin-admin-childpages.foundation-collection");
var items = $collection.find(".foundation-selections-item");
var assetPath = $(items[0]).data("foundation-collection-item-id");
I suggest to understand the existing logic in JS files shared and incorporate the code accordingly.
Will try to cover it in my blog post with detailed steps.
Please update this thread in case of clarification.
Views
Replies
Total Likes
Views
Replies
Total Likes
I have created a new post related to this subject - https://myaemlearnings.blogspot.com/2020/09/customization-in-aem-asset-quick.html
Please check
Views
Replies
Total Likes