String Format Syntax Error | Community
Skip to main content
New Participant
July 27, 2022
Solved

String Format Syntax Error

  • July 27, 2022
  • 2 replies
  • 1265 views

Actually, I am trying to format the string inside the div and when I implement the string format, I am getting a syntax error.

Error, I am getting.

"org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier card.html cannot be correctly instantiated by the Use API"

And the code is 

 

title="${item.includeIcon =='true' ? '<div class=\'sec-secondary-headings\'><h3>{0}</h3></div><div class=\'sec-paragraph\'><div class=\'p3\'>{1}</div> </div> @ format=[item.toolTitle, item.toolDescription]' : ''}"

 

I don't know what I am doing wrong. Could someone help me, please? 

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 arunpatidar

Hi,

You cannot assign the the html tags value in attribute.

Please check similar thread here https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/tooltip-syntax-error/m-p/462566#M133514 

2 replies

arunpatidar
arunpatidarAccepted solution
New Participant
July 27, 2022

Hi,

You cannot assign the the html tags value in attribute.

Please check similar thread here https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/tooltip-syntax-error/m-p/462566#M133514 

Arun Patidar
SantoshSai
New Participant
July 27, 2022

Hi @ameen_dev ,

Can you please check error.log? Is there any exception? That helps to tackle issue.

Below is one of the example.

  • format: Concatenates strings.
    Example: ${'Page {0} of {1}' @ format = [1, 10]}
    Displays: Page 1 of 10

Regards,

Santosh

Santosh Sai
Ameen_DevAuthor
New Participant
July 27, 2022

@santoshsai My Apology. I forgot to add the exact code. I have modified the code above. Please have a look. And by the way, there is no specific error in the error log.

 

Just getting this - "org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.resource.ResourceNotFoundException: Resource at '/content/dam/en/error/404' not found: No resource found"