How to Hide the "Publish" Button for folders in CARD VIEW ? | Community
Skip to main content
March 26, 2025
Solved

How to Hide the "Publish" Button for folders in CARD VIEW ?

  • March 26, 2025
  • 6 replies
  • 1050 views

Issue Overview

 

I am working in AEM and need to hide the "Publish" button that appears when hovering over individual folders in a specific path. Currently, the button is displayed dynamically for each folder, and when the cursor is removed, it disappears automatically.

 

I have tried using the granite:hide property, but it only applies to a single folder at a time. Since I have around 10 folders, I would like to know if there is a way to apply the granite:hide property globally so that it affects all folders instead of configuring it manually for each one. Please provide any other ways to solve the issue ??

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by konstantyn_diachenko

Hi @boyana1 ,

 

If you are talking about Quick Publish button in the Assets screen, you can use granite:rendercondition.

 

Publish button is located at /libs/dam/gui/content/assets/jcr:content/actions/selection/publish. You can overlay this node and add additional condition to the render condition.

 

Hopefully, it uses AND operator, so you can easily add new condition under /apps/dam/gui/content/assets/jcr:content/actions/selection/publish/granite:rendercondition. 

 

Actions to do:

1) Overlay /apps/dam/gui/content/assets/jcr:content/actions/selection/publish/granite:rendercondition

2) Add node with your render condition.

 

Render condition can be either component or Sling Servlet that will be mapped to some resource type. 

Check some examples under: /libs/granite/ui/components/coral/foundation/renderconditions

You will just need to set com.adobe.granite.ui.components.rendercondition.RenderCondition to the request:

request.setAttribute(RenderCondition.class.getName(), new OrRenderCondition(slingRequest, slingResponse, resource));

 

Best regards,

Kostiantyn Diachenko.

6 replies

arunpatidar
Community Advisor
Community Advisor
March 26, 2025

Hi @boyana1 

you can try hiding with CSS if it is global requirement , if based on path the you can rely on javascript to hide buttons based on paths.

Arun Patidar
konstantyn_diachenko
Community Advisor
konstantyn_diachenkoCommunity AdvisorAccepted solution
Community Advisor
March 26, 2025

Hi @boyana1 ,

 

If you are talking about Quick Publish button in the Assets screen, you can use granite:rendercondition.

 

Publish button is located at /libs/dam/gui/content/assets/jcr:content/actions/selection/publish. You can overlay this node and add additional condition to the render condition.

 

Hopefully, it uses AND operator, so you can easily add new condition under /apps/dam/gui/content/assets/jcr:content/actions/selection/publish/granite:rendercondition. 

 

Actions to do:

1) Overlay /apps/dam/gui/content/assets/jcr:content/actions/selection/publish/granite:rendercondition

2) Add node with your render condition.

 

Render condition can be either component or Sling Servlet that will be mapped to some resource type. 

Check some examples under: /libs/granite/ui/components/coral/foundation/renderconditions

You will just need to set com.adobe.granite.ui.components.rendercondition.RenderCondition to the request:

request.setAttribute(RenderCondition.class.getName(), new OrRenderCondition(slingRequest, slingResponse, resource));

 

Best regards,

Kostiantyn Diachenko.

Kostiantyn Diachenko, Community Advisor, Certified Senior AEM Developer, creator of free AEM VLT Tool, maintainer of AEM Tools plugin.
narendiran_ravi
Level 6
March 26, 2025

Hi @boyana1 ,

 

We have handled a similar use case where we needed to hide options globally.

To achieve this, we used the Sling Resource Merger property sling:hideChildren on the overlayed node:

/apps/dam/gui/content/assets/jcr:content/actions/selection

 

By setting this property, we were able to effectively hide the options as required.

 

giuseppebaglio
Level 10
March 27, 2025

If applicable, you can set up Access Control Lists (ACLs) based on user group membership. Additionally, you can use the default behavior of the AEM UI, which will automatically show or hide the Publish buttons. Note that there is also a "Manage Publication" button in addition to the "Quick Publish" button.

ACLs defined at the group level simplify updates, changes are made once for the entire group, avoiding the need to individually update each user. This method is particularly advantageous in organizations with numerous users, where individual permission management would be cumbersome.

 
BoyaNa1Author
March 27, 2025

Thnks for the responce teams . I just want to add I just want to add few points to my question.

 

I am working on an AEM project and need to remove the Quick Publish/ publish  button when assets or files are viewed in Card View. I have already implemented a solution to hide the Publish button in task bar  using overlay node method  , but I am facing challenges in achieving the same for Card View also in search view .

Could you please guide me on:

1. The best approach to customize the UI to hide the Quick Publish button in Card View.

narendiran_ravi
Level 6
March 28, 2025

You can overlay the path -/libs/dam/gui/coral/components/admin/contentrenderer/card/directory/quickActions.jsp for the directory and for the asset - /libs/dam/gui/coral/components/admin/contentrenderer/card/asset/quickActions.jsp

BoyaNa1Author
March 28, 2025

Can I add granite :hide property to  the above paths to hide quick publish button ??

kautuk_sahni
Community Manager
Community Manager
April 1, 2025

@boyana1 Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!

Kautuk Sahni