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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Avatar

Level 2

-

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
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

Avatar

Community Advisor

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

 

Thanks,

Kiran Vedantam.

Avatar

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>

 

 

Avatar

Correct answer by
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'}>