Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to restrict the custom button in Site Admin to a particular path ?

Avatar

Community Advisor

Hi All

 

  This is a follow up question to https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-add-a-custom-button... . I was able to create the button, but I want that button to be available only to a particular path under sites.html. Any idea ?

 

TIA

Veena

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Veena_Vikram,

We can make use of granite:rendercondition with resourceType being the servlet (registered with resourceType) where the path restriction can be handled by making use of custom properties set on rendercondition resource together with its respective logic in servlet.

Similar implementation is available in below blog post

http://aemlab.blogspot.com/2019/07/aem-granite-custom-render-conditions.html

 

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi @Veena_Vikram,

We can make use of granite:rendercondition with resourceType being the servlet (registered with resourceType) where the path restriction can be handled by making use of custom properties set on rendercondition resource together with its respective logic in servlet.

Similar implementation is available in below blog post

http://aemlab.blogspot.com/2019/07/aem-granite-custom-render-conditions.html

 

Avatar

Community Advisor
Thanks a lot @Vijayalakshmi_S . It works like magic 🙂 @Arun_Patidar you are awesome 🙂 Thanks for the blog 🙂

Avatar

Community Advisor
@Arun_Patidar This works fine, but when I navigate to other content tree, it still remains hidden unless I refresh the page.