AEM 6.3 Check edit mode issue in HTL | Community
Skip to main content
May 25, 2018
Solved

AEM 6.3 Check edit mode issue in HTL

  • May 25, 2018
  • 3 replies
  • 4292 views

Hi All,

We are using 6.3 and just giving <div data-sly-test="${wcmmode.edit}">Edit Mode</div> is not working.

If we remove editor.html/ from the url and reload it, the Edit Mode text still appear.

Tried the thing mentioned in http://wcmaem.blogspot.in/2016/07/how-to-check-touch-ui-mode-in-sightly.html but same issue, only adding ?wcmmode=disabled at the end of the url is working.

Is someone have a workaround ?

Regards

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 arunpatidar

@EmericL

You need to change the mode other than EDIT before reloading the page without editor.html

Hope this will help.

3 replies

smacdonald2008
Level 10
May 25, 2018

It works fine - just tested. Here is my component:

<sly data-sly-test="${wcmmode.edit}">

     <h4>XYZ</h4>

</sly>

<sly data-sly-test="${wcmmode.disabled}">

     <h4>ABC</h4>

</sly>

In edit mode - XYZ shows up:

When page is displayed out of edit mode - XYZ disappears as expected:

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
May 25, 2018

@EmericL

You need to change the mode other than EDIT before reloading the page without editor.html

Hope this will help.

Arun Patidar
EmericLAuthor
May 28, 2018

Thanks for the tips arunp99088702 this was the issue.

I think it's not very usable and confusing for the user.

If we open two tabs, one in edit mode and the other in preview the last changed page mode is taken for both because this functionality is cookie based.