Skip to main content
Level 3
September 21, 2022
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
Community Advisor
September 21, 2022

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
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 21, 2022

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
September 22, 2022

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