design mode in slightly | Community
Skip to main content
Level 4
Nov 11, 2020 10:48 AM UTC
Solved

design mode in slightly

Hi Team,

${wcmmode.design} is giving false even in design mode.

Please help me to resolve the issue.

Aem version - 6.4

 

Thanks,

Sandeep.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Shubham_borole
Shubham_boroleAccepted solution
New Participant
Nov 13, 2020 1:26 AM UTC

Hi @777157 can you try the code line below ? Otherwise what you have mentioned seems like should work too.. Below kind of logic seems to work for me

 

//Display test1 if in design mode or test2 in edit mode <sly data-sly-test.author="${wcmmode.design}">test1</sly> <sly data-sly-test.author="${wcmmode.edit}">test2</sly>

 

12 replies

Shubham_borole
New Participant
Nov 13, 2020 9:06 PM UTC

@sandeep6 

Using below in java also gives "edit" for value of wcmMode when loaded the page in design mode.

 

WCMMode wcmMode = WCMMode.fromRequest(slingRequest);

 

Also needed to refresh the page for the model to be invoked.

Something that worked was trying similar to below

 

slingRequest.getCookie("cq-editor-layer.page").getValue()

 

 
 

 

 

Translate
Shubham_borole
Shubham_boroleAccepted solution
New Participant
Nov 13, 2020 1:26 AM UTC

Hi @777157 can you try the code line below ? Otherwise what you have mentioned seems like should work too.. Below kind of logic seems to work for me

 

//Display test1 if in design mode or test2 in edit mode <sly data-sly-test.author="${wcmmode.design}">test1</sly> <sly data-sly-test.author="${wcmmode.edit}">test2</sly>

 

Translate
arunpatidar
New Participant
Nov 12, 2020 11:26 PM UTC

are you able to see the design mode set in cookies?

could you try with java API https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/javadoc/com/day/cq/wcm/api/WCMMode.html

Translate
Arun Patidar
Sandeep6Author
Level 4
Nov 13, 2020 4:24 AM UTC

Is there anywany to get design mode in slightly?

Translate
Umesh_Thakur
New Participant
Nov 11, 2020 12:53 PM UTC

I don't think so we can get design mode in AEM6.4

Translate
SureshDhulipudi
New Participant
Nov 11, 2020 11:43 AM UTC

<sly data-sly-test="${wcmmode.design}"></sly> - this syntax should work

can you give your complete html source here

Translate
Sandeep6Author
Level 4
Nov 11, 2020 12:12 PM UTC
<sly data-sly-test="${wcmmode.design}"> <h4>XYZ</h4> </sly>
Translate