Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Disable Delete button on sites console


Level 2

AEM Author should be unable to delete content/page once it published.


- Once author selects page from sites console, we have to disable the delete button if page was in published status.

- we need to enable the delete button if page is not in published status.

- Once author selects any page from sites console it shows action bar that means we are calling listeners (java script files) for showing action bar buttons on sites console.

Question is:

please let me know exact listeners java script files or paths that calls when we select the page on sites console.

8 Replies


Level 8

Overlay this node in your project /libs/wcm/core/content/sites/jcr:content/actions/selection

copy the above sites page from libs and paste it under /apps/wcm/core/content

Remove the deletepage node under this node.




Level 2
I am wondering why this solution is flagged as accepted solution because it does not handle the scenario when delete button should be available for unpublished pages, removing delete action would make it unavailable irrespective of whether page is published or not.


Level 2

it should not show disable mode in every time.it has to show enable mode when page is not in published status.

Below is the status has to show when page is in activated or deactivated status:

if page is activated -disable delete button

if page is not activated - enable delete button

when author selects the page from console it shows action tool bar (these action bar items populates using listeners). so i want the listeners (java script files) that shows for action bar after selecting the page from console.if we know that, we can add our disable condition on listener.


Level 8

Go to /libs/cq/gui/components/siteadmin/admin/clientlibs/collectionpage/js/viewpropertiesaction.js

Overlay the above js , copy to apps and edit the one in apps /apps/cq/gui/components/siteadmin/admin/clientlibs/collectionpage/js/viewpropertiesaction.js

go to line number line number 91 and add this line

if (isActivated(selections)) {       





Level 2

Thank you for response.

-  But it is disabling every time. can't we enable for not activated/not published pages.

-  Can we do same for damadmin also ?



Have you tried custom render conditions? Refer:

1. GitHub - nateyolles/aem-granite-rendercondition-demo: AEM Granite Render Condition demo

Disable functionality can also be achieved using ACL's as well (button will not get disabled but delete operation will fail). You can set ACL on content node of page or asset (remove delete privilege) via custom Preprocessor when a page/asset is published. When a page is unpublished, you can remove these ACLs.



There is no easy way to do so to solve problem efficiently.

On top of the solution suggested by Hemant, you can always check the status of page is activated or not and hide disable button accordingly.

Best way would be to create custom workflow and there you can put all the checks that you want to achieve.


Kautuk Sahni


Level 2

I guess you are looking this js-  /libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/collection/action/action.js