Set dynamic meta tag (for OG) in component | Community
Skip to main content
Level 3
Sep 21, 2022 9:27 AM UTC
Solved

Set dynamic meta tag (for OG) in component

Dear community,

 

I'm trying to set dynamic meta tag on my page for open graph (OG) that can be seen when sharing via social media (AEM 6.5).

 

I can now set a default one in structure/page/customheaderlibs.

However, some pages contain specific images, and I want to replace the default OG content with the image link in my page/component. Is it possible to do so?

 

Since social media crawler doesn't interpret JS, I suppose this should be set at component level.

 

Thank you in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Sep 21, 2022 12:27 PM UTC

Hi,

I would suggest to create a page property to brows specific images from dam path or write a logic in model to read image form specific component (if component type is fixed).

Arun Patidar

2 replies

arunpatidar
arunpatidarAccepted solution
New Participant
Sep 21, 2022 12:27 PM UTC

Hi,

I would suggest to create a page property to brows specific images from dam path or write a logic in model to read image form specific component (if component type is fixed).

Translate
Arun Patidar
YuShengAuthor
Level 3
Sep 22, 2022 2:26 AM UTC

Thank you @arunpatidar : )

I think I would replicate and customize the structure/page for the component template. Cannot make it 100% dynamic, at least some components can have its own OG.

Translate