Expand my Community achievements bar.

SOLVED

AEM 6.1 Determine Preview mode in sightly

Avatar

Level 2
Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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>

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

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>

Avatar

Level 2
Level 2

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

Thanks,