Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Hide and Show Quick Publish and Manage Publication buttons based on the condition in the site console

Avatar

Level 3

Hi Team,
I want  hide the Quick Publish and Manage Publication buttons based on the condition in the site console

If it starts  "/content/www/language-masters " then need to hide the Quick Publish and Manage Publication buttons
When it starts "/content/www/us/en" then based on the select checkbox, need to enable the Quick Publish and Manage Publication buttons.

Screenshot 2023-09-01 at 11.08.33 AM.png


I used the below script but when selected the child pages the script was not loading, Because of the dynamic loading of child pages.

$('._coral-Checkbox').click(function() { 

 alert(“”checkbox checked);

  });


@EstebanBustamante  @Mahedi_Sabuj   

@aanchal-sikka  @arunpatidar  @sherinregi @harwindersingh 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @naruk89179065 

 

There are multiple approaches:

1. Using path based render condition from ACS commons

https://adobe-consulting-services.github.io/acs-aem-commons/features/ui-widgets/path-rendercondition...

 

2. Or use expression with simple render condition

expression="${granite:relativeParent(requestPathInfo.suffix, 3) != '/content/www/language-masters')}"/>

http://www.nateyolles.com/blog/2016/07/aem-granite-custom-render-conditions

 

 


Aanchal Sikka

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @naruk89179065,

You can address the issue by either adjusting User Permissions or utilizing granite:renderCondition. A detailed discussion is available here. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-disable-hide-quick-... 

Avatar

Level 3

thanks @Mahedi_Sabuj 
When the Page loads it works fine, but every time when need to select the page checkbox, then needs to hide and show based on the path


Avatar

Level 5

All the responses stated above are close to what you may need. However since you are looking for controlling the existing buttons based on items selected, you may have to override some built in js. Or probably add a custom js to alter the behavior. Sorry I can't be sure as it's been a while I worked on this sort of a change. As of today these icons are rendered based on users permissions. A particular class is associated with the action they represent and show hide behavior is controlled by it. Now we may need to change this behavior by including addl condition based on selected item's path, which again should be retrieveable in ur js. Please see if these pointers help. If not I can dig a little deeper and advise u further. Thanks 

Avatar

Correct answer by
Community Advisor

Hello @naruk89179065 

 

There are multiple approaches:

1. Using path based render condition from ACS commons

https://adobe-consulting-services.github.io/acs-aem-commons/features/ui-widgets/path-rendercondition...

 

2. Or use expression with simple render condition

expression="${granite:relativeParent(requestPathInfo.suffix, 3) != '/content/www/language-masters')}"/>

http://www.nateyolles.com/blog/2016/07/aem-granite-custom-render-conditions

 

 


Aanchal Sikka