Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Hi guys,
How to handle
<meta name="description" content="${seoProps.description}" />
output:
<meta name="description" content="" />
Thanks!
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
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,
Vistas
Respuestas
Total de me gusta
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.
Vistas
Respuestas
Total de me gusta
I think Daniel has provided you with correct answer. Please verify it.
~kautuk
Vistas
Respuestas
Total de me gusta
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'} " />
Vistas
Respuestas
Total de me gusta
@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.
Vistas
Respuestas
Total de me gusta
Only for style and script it is mandatory to specify the context.
Vistas
Respuestas
Total de me gusta
Hi
Please confirm if the experts suggestion help you here.
~kautuk
Vistas
Respuestas
Total de me gusta
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,
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas