Unable to build the code- [WARNING] C:\Users\VACNIT\Desktop\Project Data\aem-sites\ui.apps\src\main\content\jcr_root\apps\SFEM\components\page\head.html [25:21]: ${properties.snippetheadstartcurall}: data-sly-test: redundant constant value compari | Community
Skip to main content
arjunsudhas1995
New Participant
November 30, 2021
Solved

Unable to build the code- [WARNING] C:\Users\VACNIT\Desktop\Project Data\aem-sites\ui.apps\src\main\content\jcr_root\apps\SFEM\components\page\head.html [25:21]: ${properties.snippetheadstartcurall}: data-sly-test: redundant constant value compari

  • November 30, 2021
  • 2 replies
  • 1477 views
Here is my snippet. Unable to build the code due to redundancy warning. build fails. But code works fine in direct deployment
 
<sly data-sly-test=" ${properties.snippetheadstartcurall}">
 <sly> ${properties.snippetheadstartcurall @ context='unsafe'}</sly>
 </sly>
 <sly data-sly-test=" ${!properties.snippetheadstartcurall}">
   <sly>  ${inheritedPageProperties.snippetheadstartcurall @ context='unsafe'}
   </sly>
 
Error info:
[WARNING] C:\Users\VACNIT\Desktop\Project Data\aem-sites\ui.apps\src\main\content\jcr_root\apps\SFEM\components\page\head.html [25:21]: ${properties.snippetheadstartcurall}: data-sly-test: redundant constant value comparison
[WARNING] C:\Users\VACNIT\Desktop\Project Data\aem-sites\ui.apps\src\main\content\jcr_root\apps\SFEM\components\page\head.html [28:22]: ${!properties.snippetheadstartcurall}: data-sly-test: redundant constant value comparison
please assist
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 mayank0928

Hi @arjunsudhas1995 

 

You can try to modify this by using ternary operator like,

<sly>${properties.snippetheadstartcurall ? properties.snippetheadstartcurall : inheritedPageProperties.snippetheadstartcurall @ context='unsafe'}</sly>

Hope it'd help!

2 replies

arunpatidar
New Participant
December 1, 2021
<sly data-sly-test.snippet=" ${properties.snippetheadstartcurall}" />
<sly data-sly-test="${snippet}"> ${snippet @ context='unsafe'}</sly>
<sly data-sly-test="${!snippet}">${inheritedPageProperties.snippetheadstartcurall @ context='unsafe'}</sly>

You can define a variable and reuse with data-sly-tes as well. 

 

You can use the solution suggested by @mayank0928 

Arun Patidar
mayank0928
mayank0928Accepted solution
New Participant
November 30, 2021

Hi @arjunsudhas1995 

 

You can try to modify this by using ternary operator like,

<sly>${properties.snippetheadstartcurall ? properties.snippetheadstartcurall : inheritedPageProperties.snippetheadstartcurall @ context='unsafe'}</sly>

Hope it'd help!

arjunsudhas1995
New Participant
December 6, 2021

thanks 😊