AEM 6.3 Check edit mode issue in HTL | Community
Skip to main content
New Participant
May 25, 2018 2:21 PM UTC
Solved

AEM 6.3 Check edit mode issue in HTL

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.
arunpatidar
arunpatidarAccepted solution
New Participant
May 25, 2018 4:03 PM UTC

@EmericL

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

Hope this will help.

Arun Patidar

3 replies

EmericLAuthor
New Participant
May 28, 2018 8:21 AM UTC

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.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
May 25, 2018 4:03 PM UTC

@EmericL

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

Hope this will help.

Translate
Arun Patidar
smacdonald2008
Level 10
May 25, 2018 2:31 PM UTC

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:

Translate