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 ??
Views
Replies
Total Likes
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.
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.
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.
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.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Can I add granite :hide property to the above paths to hide quick publish button ??
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Views
Likes
Replies