design mode in slightly | Community
Skip to main content
Level 4
November 11, 2020
Solved

design mode in slightly

  • November 11, 2020
  • 5 replies
  • 2602 views

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.
Best answer by Shubham_borole

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>

 

5 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

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

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

arunpatidar
Community Advisor
Community Advisor
November 12, 2020
Arun Patidar
Sandeep6Author
Level 4
November 13, 2020

Is there anywany to get design mode in slightly?

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>

 

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()