Expand my Community achievements bar.

SOLVED

Set dynamic meta tag (for OG) in component

Avatar

Level 4

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!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 4

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.