Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
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'}>