CQ5.4: How to display a confirmation dialog when activating pages

Issue

If you are using CQ5.x you will notice that there is a confirmation dialog for deleting/deactivating pages in the WCM console.  No such confirmation dialog is presented when you activate a page.  In some projects it may be a requirement to present such a confirmation dialog for activation also.

Solution

You will have to overlay:
/libs/cq/ui/widgets/source/widgets/wcm/SiteAdmin.Actions.js
to
/apps/cq/ui/widgets/source/widgets/wcm/SiteAdmin.Actions.js
Create the same folder structure in apps and then copy the SiteAdmin.Actions.js node from libs to the same folder in apps. This will ensure the jcr:content node under the JS file is also copied.

Then edit the SiteAdmin.Actions.js from apps.  You should replace the CQ.wcm.SiteAdmin.activatePage function with the lines (435-520) from this SiteAdmin.Actions.js file.

Note

Ideally you should not not completely overlay the siteadmin.Actions.js as you might run into problems when a SP brings a new SiteAdmin.Actions.js with it. Instead just overlay the function you want to change.  Use the clientlib approach and create a new JS file, attach it to the same clientlib as the SiteAdmin.Actions.js and redefine the function you want to change in that new JS file.

reference: (35823)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 1.0/10 (1 vote cast)
CQ5.4: How to display a confirmation dialog when activating pages, 1.0 out of 10 based on 1 rating

Comments are closed.