AEM 6.1 | Disable tab in AEM dialog | Community
Skip to main content
Level 3
July 1, 2016
Solved

AEM 6.1 | Disable tab in AEM dialog

  • July 1, 2016
  • 4 replies
  • 3115 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by CQ_learner

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

4 replies

Tuhin_Ghosh
Level 8
July 3, 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%20Field%20Events

You can refer to the above url for guidance.

 

Thanks

AnkurAhlawat-1
Level 6
July 4, 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.

Adobe Employee
July 5, 2016
CQ_learnerAuthorAccepted solution
Level 3
July 6, 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'];
    }