3
votes

Is it possible to insert thumbnail image URL from page properties of Thumbnail tab into og:image inside meta tag. I am able to get values of pageTitle and description properties but not the image. Or is there a better way to handle this?

<meta property="og:url" content="${head.pagePath}" />
<meta property="og:title" content="${properties.pageTitle}" />
<meta property="og:description" content="${properties['jcr:description']}" />
<meta property="og:image" content="imageURL" />
1

1 Answers

2
votes

You can reference it as ${properties['image/fileReference']} if it is provided via DAM (so you can use web renditions this way). If the asset is attached to the page itself (uploaded directly) you can use Thumbnail servlet to reference rendered thumbnails using following convention: /content/[path-to-the-page].thumb.319.319.png

AEM creates 48x48, 140x100 and 319x319 thumbnails out of the box, since you are planning to use it for providing reference to reusable image via OpenGraph protocol you might need to customize thumbnails creation workflow to add higher resolution into the pipeline.