Sightly Issue : data-sly-test: redundant constant value comparison | Community
Skip to main content
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 aem_raw

Use "data-sly-set" instead of "data-sly-test" to define variable to get rid of this error

Example:

<sly data-sly-set.variableName=${'value'}>

 

 

3 replies

Kiran_Vedantam
Community Advisor
Community Advisor
January 6, 2021

Hi @sumit1191, Can you please elaborate on your query.

 

Thanks,

Kiran Vedantam.

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 6, 2021

 

@sumit1191 

You can store / not-store the returned value, something like this:

 

// example 1 : store the returned value, and use it <sly data-sly-test.skuNumber="${mymodel.skuNumber}"> <p>SKU Number: ${skuNumber}</p> </sly> // example 1 : not-store the returned value, rather wrapping block of code <sly data-sly-test="${wcmmode.edit}"> <p>Welcome the the edit mode</p> </sly>

 

 

aem_rawAccepted solution
Level 2
June 30, 2021

Use "data-sly-set" instead of "data-sly-test" to define variable to get rid of this error

Example:

<sly data-sly-set.variableName=${'value'}>