Expand my Community achievements bar.

Opening specific template pages in editor.html AEM 6.1, AEM 6.2

Avatar

Community Advisor

Recently in our project we have requirement to open few pages which are created using specific template in editor.html while other in cf#. Since we are in AEM 6.2 and started creating components in touch ui but most of them are still in classic. AEM has configuration to set to open pages in editor.html or User can set the preference to open in editor.html but cannot open the page in editor.html based on template.

Steps to open a page created using specific template in editor.html

1) Overlay the below js file from libs to apps

    

     Copy from: \libs\cq\ui\widgets\source\widgets\wcm\SiteAdmin.Actions.js

     Copy to: \apps\cq\ui\widgets\source\widgets\wcm\SiteAdmin.Actions.js

2) In function CQ.wcm.SiteAdmin.openPage include below else if

    else if (typeof selection != 'undefined' && typeof selection.data != 'undefined'

    && typeof selection.data.templatePath != 'undefined' && selection.data.templatePath

    && selection.data.templatePath.indexOf("Give your template path") > -1) {

    var url = CQ.HTTP.externalize("/editor.html"+path+".html");

        if (CQ.wcm.SiteAdmin.multiWinMode == undefined) {

            var wm = CQ.User.getCurrentUser().getPreference("winMode");

            CQ.wcm.SiteAdmin.multiWinMode = (wm != "single");

        }

    if (newWindow || CQ.wcm.SiteAdmin.multiWinMode) {

            CQ.shared.Util.open(url);

        } else {

            CQ.shared.Util.load(url);

        }   

     }

Note: Above code will open the page in editor.html only from siteadmin console when double click.

3 Replies