Opening specific template pages in editor.html AEM 6.1, AEM 6.2 | Community
Skip to main content
Ravi_Pampana
Community Advisor
Community Advisor
October 17, 2017

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

  • October 17, 2017
  • 3 replies
  • 2456 views

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.

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

3 replies

smacdonald2008
Level 10
October 18, 2017

Excellent community content!

VeenaVikraman
Community Advisor
Community Advisor
October 18, 2017

Good one !!

kautuk_sahni
Community Manager
Community Manager
October 20, 2017

This is really great!! Thanks a lot for sharing!!

~kautuk

Kautuk Sahni