Expand my Community achievements bar.

SOLVED

AEM as cloud | SEO | structured data markup

Avatar

Level 7

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

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

Sady_Rifat_0-1693388566427.png

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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

Sady_Rifat_0-1693388566427.png

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.