Hi guys,
How to handle
<meta name="description" content="${seoProps.description}" />
output:
<meta name="description" content="" />
Thanks!
Solved! Go to Solution.
Thanks all ! Sorry I didn't answer.
seoProps.description return String type.
if seoProps.description is empty, output is: content=""
I do it like this.
<meta name="description" content="${seoProps.description || true}">
output: <meta name="description" content />
Thanks,
Views
Replies
Total Likes
Hi.
Do you mean how to hide the tag if seoProps.description is null/empty?
Have you tried
<meta data-sly-test="${seoProps.description}" name="description" content="${seoProps.description}" />
?
Regards,
Daniel.
I think Daniel has provided you with correct answer. Please verify it.
~kautuk
Views
Replies
Total Likes
Daniel is right, and also dont forget to escape if the content has special characters.
<meta data-sly-test="${seoProps.description}" name="description" content="${seoProps.description @ context = 'scriptString'} " />
@Conexio Group, Sightly is smart enough to figure out which context to use, most of the time:
So, for regular attributes, I wouldn't add anything.
Regards,
Daniel.
Only for style and script it is mandatory to specify the context.
Hi
Please confirm if the experts suggestion help you here.
~kautuk
Views
Replies
Total Likes
Thanks all ! Sorry I didn't answer.
seoProps.description return String type.
if seoProps.description is empty, output is: content=""
I do it like this.
<meta name="description" content="${seoProps.description || true}">
output: <meta name="description" content />
Thanks,
Views
Replies
Total Likes