Is there any way to find out whether we have opened page in Touch UI or classic UI in javascript | Community
Skip to main content
manank71376227
Level 2
January 1, 2016
Solved

Is there any way to find out whether we have opened page in Touch UI or classic UI in javascript

  • January 1, 2016
  • 3 replies
  • 1315 views

Is there any way to find out whether we have opened this page in Touch UI or classic UI in javascript

like we have in classic UI to find out whether page is in edit mode or design mode.

CQ.WCM.editMode

Please suggest.

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 edubey

Hi,

I would recommend to you widget API method provided for these:

https://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.WCM

getMode() - Returns either the current WCM mode: MODE_EDITMODE_PREVIEW and MODE_DESIGN, or MODE_TIMEWARP

Thanks

3 replies

Jitendra_S_Toma
Level 10
January 2, 2016

Easiest way to find out a solution in javascript is through AEM page URL.

  1. If the URL contains ëditor.html" then it is TOUCH UI
  2. If the URL contains "cf#" then it is in classic view.

This could work for now However, if someone changes these URL's ( through config or adobe next release), this solution wont work.

---Jitendra

manank71376227 wrote...

Is there any way to find out whether we have opened this page in Touch UI or classic UI in javascript

like we have in classic UI to find out whether page is in edit mode or design mode.

CQ.WCM.editMode

Please suggest.

 

edubey
edubeyAccepted solution
Level 10
January 2, 2016

Hi,

I would recommend to you widget API method provided for these:

https://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.WCM

getMode() - Returns either the current WCM mode: MODE_EDITMODE_PREVIEW and MODE_DESIGN, or MODE_TIMEWARP

Thanks

Jitendra_S_Toma
Level 10
January 2, 2016
Adding to what already said about using cq api,  just make sure cq widgets do not get loaded on publish instance. - Jitendra