AEM Sightly - Check if edit mode

Avatar

Avatar

LaMind3

Avatar

LaMind3

LaMind3

09-10-2020

I am working AEM 6.5 , I want to add a functionality on preview mode alone, not on edit mode . I tried adding below condition . But its not working. Can someone help me out here?

<sly data-sly-test="${wcmmode.edit}">
EDIT MODE:
</sly>
<sly data-sly-test="${wcmmode.disabled}">
<div>some code here..</div>
</sly>
AEM 6.5
View Entire Topic

Avatar

Avatar

Ravi_Pampana

MVP

Avatar

Ravi_Pampana

MVP

Ravi_Pampana
MVP

09-10-2020

Hi,

 

Try "wcmmode.preview" but when we change from edit mode to preview there wont be page refresh and this will not work as intended. You need to do a page refresh on selecting preview mode.

 

Hope this helps!