Forum Discussion

Hoekstra_VFZ's avatar
4 years ago

Create better looking links for sharing on social media

Hi all,

Maybe some of you would like to know how to get a nice preview image when sharing a Community link on social media.

First create an image with size 1200 x 630, smaller then 300kb (WhatsApp won't generate an image if larger). Leave plenty of safe area round the edges.

Upload the image here in Studio:

 Then we added the following lines to 'Page Head Bottom Content' of the Wrapper :

<!-- Social Sharing Image Meta Tags -->
<meta property="og:image" content="${asset.get('/html/assets/og_vodafone-1.jpg')}">
<meta name="twitter:image" content="${asset.get('/html/assets/og_vodafone-1.jpg')}">

 

That's it! After publishing check out https://www.opengraph.xyz/ if all is looking good:

The main advantage setting it this way instead of node by node is ease of maintenance. Just replace the asset if you need a new image for all your pages.

No RepliesBe the first to reply