Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

AEM 6.1 | Disable tab in AEM dialog

Avatar

Level 4

Hi All,

How Can i disable a tab in author dialog based on the current page template? I know i need to use a listener, can someone please tell me how to use it?

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi All,

Below function worked for me, thanks for your replies

function(dialog){
        var pagePath = CQ.utils.WCM.getPagePath()+"/jcr:content.json";
        var result = CQ.shared.HTTP.eval(pagePath);   
        var currentTemplate = result['cq:template'];
    }

View solution in original post

4 Replies

Avatar

Level 7

You need to write a dialog listener for the same.

https://docs.adobe.com/docs/en/aem/6-1/develop/components/components-touch-optimized.html#Handling%2...

You can refer to the above url for guidance.

 

Thanks

Avatar

Level 7

You cannot disable a tab based on template selection using listeners, as you have an instance of current dialog from which you cannot retrieve the current template.

Avatar

Correct answer by
Level 4

Hi All,

Below function worked for me, thanks for your replies

function(dialog){
        var pagePath = CQ.utils.WCM.getPagePath()+"/jcr:content.json";
        var result = CQ.shared.HTTP.eval(pagePath);   
        var currentTemplate = result['cq:template'];
    }