Skip to main content
Level 5
ago 30, 2023 5:34 a. m. UTC
Resuelto

AEM as cloud | SEO | structured data markup

Hi Folks,

 

As part of SEO best practice, I need to attach 'structured data markup' at page level 

using script type="application/ld+json"

Which has some other attributes like page name, description, org name etc

Each page has it's detail in this script.

How could I do this in AEM as cloud service?

 

Any pointers is highly appreciated. 

 

Thanks,

Pradeep

 

 

Este tema ha sido cerrado para respuestas.
Sady_Rifat
Sady_RifatRespuesta
Community Advisor
ago 30, 2023 10:04 a. m. UTC

Hello @pradeepdubey82 ,
You can use Sling Deligation Pattern and write your desired Json scheme in Java.

after that, you can use it on your page.html

<script type="application/ld+json">${page.schemaJsonLD @context='unsafe'}</script>


Another way,
You can directly add your LD script to page.html and fill properties via ${properties.title} and so on.
But I would recommend the 1st one.

1 respuesta

Sady_Rifat
Community Advisor
Sady_RifatCommunity AdvisorRespuesta
Community Advisor
ago 30, 2023 10:04 a. m. UTC

Hello @pradeepdubey82 ,
You can use Sling Deligation Pattern and write your desired Json scheme in Java.

after that, you can use it on your page.html

<script type="application/ld+json">${page.schemaJsonLD @context='unsafe'}</script>


Another way,
You can directly add your LD script to page.html and fill properties via ${properties.title} and so on.
But I would recommend the 1st one.

Traducir