Opening specific template pages in editor.html AEM 6.1, AEM 6.2 | Community
Skip to main content
Ravi_Pampana
New Participant
Oct 17, 2017 3:40 AM UTC

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

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

kautuk_sahni
Employee
Oct 20, 2017 4:10 AM UTC

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

~kautuk

Translate
Kautuk Sahni
VeenaVikraman
New Participant
Oct 18, 2017 3:30 AM UTC

Good one !!

Translate
smacdonald2008
Level 10
Oct 18, 2017 12:03 AM UTC

Excellent community content!

Translate