Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Sightly Issue : data-sly-test: redundant constant value comparison

1 Accepted Solution
aem_raw
Correct answer by
Level 2
Level 2

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'}>

 

 

View solution in original post

3 Replies
KiranVedantam1992
Community Advisor
Community Advisor

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

 

Thanks,

Kiran Vedantam.

BrianKasingli
Community Advisor
Community Advisor

 

@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_raw
Correct answer by
Level 2
Level 2

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'}>

 

 

View solution in original post