Expand my Community achievements bar.

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

Avatar

Level 1

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 ??

8 Replies

Avatar

Community Advisor

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

Avatar

Community Advisor

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.

Avatar

Level 8

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.

narendiran_ravi_0-1743013591878.png

 

Avatar

Level 7

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.

 

Avatar

Level 1

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 .

IMG_20250327_193059.jpg

Could you please guide me on:

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

Avatar

Level 8

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

Avatar

Level 1

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

Avatar

Level 8

I have not tried this, but we need to add a  condition or remove the code in the respective jsp file by overlaying it under /apps