AEM 6.1 Determine Preview mode in sightly | Community
Skip to main content
Jit
New Participant
October 16, 2015
Solved

AEM 6.1 Determine Preview mode in sightly

  • October 16, 2015
  • 2 replies
  • 6947 views

In AEM 6.0, using

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

would be false in "preview" mode in the authoring instance.  However, this is no longer the case in 6.1.  Trying to use ${wcmmode.preview} also doesn't work.  Is there a way to determine if the page is in preview mode in sightly?

Thanks

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 Feike_Visser1

Just tested this in AEM6.1, and works just fine.

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

2 replies

Feike_Visser1
Feike_Visser1Accepted solution
Employee
October 16, 2015

Just tested this in AEM6.1, and works just fine.

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

Jit
JitAuthor
New Participant
October 16, 2015

Ah.. i need to refresh the page in order to pick up the change when i swap modes.

Thanks,