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" />
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Thank you all for your replies. I studied Social Sharing core component source code for a bit and ended up re-using getThumbnail() method to get page thumbnail reference and that worked out as expected.
if the thumbnail image is coming from DAM ,then the page have "image" node in jcr:content of page and that image node will be having fileReference property which will have your image path of thumbnail. In this case you can make use of resource object and get the child node image and then get the property(fileReference).
If the thumbnail has been uploaded from file system in template. In that case it will not be easy to get.i would say take thumbnail from DAM.
Views
Replies
Total Likes
It depends on your customization (Static/Editable templates). If you're not customizing anything then it would store here:/content/yourpagepath/jcr:content/image. If you look at the property of fileReference then you'll the image ref path. You'll have to use Server Side script (JavaScript API) or use Java to read this and inject back to HTL/HTML.
Views
Replies
Total Likes
Thumbnail are generated either from template(DAM or browsed image) or uploading direct on page. If you have thumbnail reference from DAM then you can see a property in page otherwise you need to read from local but you can't use that in og tags.
Thank you all for your replies. I studied Social Sharing core component source code for a bit and ended up re-using getThumbnail() method to get page thumbnail reference and that worked out as expected.
Hey @irmantasluk Could you please help with this? I have the same issue
Views
Replies
Total Likes
Did you resolve this issue? Since, I'm facing the same issue
Views
Replies
Total Likes