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

Avatar

Avatar
Validate 1
Level 1
Sumit1191
Level 1

Likes

0 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Sumit1191
Level 1

Likes

0 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
Sumit1191
Level 1

05-01-2021

-

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 3
Level 2
aem_raw
Level 2

Likes

4 likes

Total Posts

8 posts

Correct reply

2 solutions
Top badges earned
Boost 3
Give Back
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Boost 3
Level 2
aem_raw
Level 2

Likes

4 likes

Total Posts

8 posts

Correct reply

2 solutions
Top badges earned
Boost 3
Give Back
Validate 1
Boost 1
Affirm 1
View profile
aem_raw
Level 2

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

 

 

Answers (2)

Answers (2)

Avatar

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
BrianKasingli
MVP

Likes

645 likes

Total Posts

607 posts

Correct reply

239 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
BrianKasingli
MVP

06-01-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>

 

 

Avatar

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

195 likes

Total Posts

213 posts

Correct reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

195 likes

Total Posts

213 posts

Correct reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile
KiranVedantam1992
Level 7

06-01-2021

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

 

Thanks,

Kiran Vedantam.