Skip to main content
Level 4
November 11, 2020
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
Community Advisor
November 13, 2020

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

SureshDhulipudi
Community Advisor
Community Advisor
November 11, 2020

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

can you give your complete html source here

Translate
Sandeep6Author
Level 4
November 11, 2020
<sly data-sly-test="${wcmmode.design}"> <h4>XYZ</h4> </sly>
Translate
Umesh_Thakur
Community Advisor
Community Advisor
November 11, 2020

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

Translate
arunpatidar
Community Advisor
Community Advisor
November 12, 2020

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
November 13, 2020

Is there anywany to get design mode in slightly?

Translate
Shubham_borole
Community Advisor
Shubham_boroleCommunity AdvisorAccepted solution
Community Advisor
November 13, 2020

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
Shubham_borole
Community Advisor
Community Advisor
November 13, 2020

@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