AEM 6.1 | Disable tab in AEM dialog

Avatar

Avatar

CQ_learner

Avatar

CQ_learner

CQ_learner

01-07-2016

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?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

CQ_learner

Avatar

CQ_learner

CQ_learner

06-07-2016

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'];
    }

Answers (3)

Answers (3)

Avatar

Avatar

chiradeepm69851

Employee

Avatar

chiradeepm69851

Employee

chiradeepm69851
Employee

05-07-2016

Avatar

Avatar

AnkurAhlawat

Avatar

AnkurAhlawat

AnkurAhlawat

04-07-2016

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

Avatar

Tuhin_Ghosh

Avatar

Tuhin_Ghosh

Tuhin_Ghosh

03-07-2016

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