Showing results for 
Show  only  | Search instead for 
Did you mean: 

Post preview on LinkedIn

Hi experts,

I experience this annoying behavior every time I want to link a Community post on LinkedIn: the preview displays the avatar of the author instead of the cover image.



Do you know how to overcome this undesired behavior? Do I miss something?

Thanks for any hints,


5 Replies 5
Khoros Staff

Hello @karolinalinda,
This is how we are dealing with it in our community:

<#assign images = (liql('SELECT large_href FROM images WHERE = "${page.context.message.uniqueId}"').data.items) />
<#if images?? && (images?size gt 0) >
<#assign img_url = images[0].large_href />
<#assign lengthOfDomain = page.context.message.webUi.url?index_of("/t5") />
<#assign communityDomain = page.context.message.webUi.url?substring(0,lengthOfDomain) />
<#assign message_img_url = communityDomain + img_url />
<meta property="og:image" content="${message_img_url}" />
<meta property="og:image" content="${asset.get("/html/assets/<some default image>")}"/>

The above code should be added to the head.ftl file.

Code Explanation: First we are pulling the image from the message body and check if any image exist, then use it otherwise use a default image from assets.

Let me know if that helps or we can connect sometime if you want me to replicate same on your community.

Abhishek Gupta

Thank you, Abhishek - we'll test it! 🙂 


hello @AbhishekGu 

We're having the same issue. Can you tell me where is the head.ftl? Is Studio? 


Khoros Staff

Hello @stehrani71 
Yes, that's in studio. Exact location is as follows:

Studio > Community Style > Wrapper 

Here choose your community skin and on the right hand side you can see Page Head Bottom Content (head.ftl).

Hi Abhisek,

I tried to implement this script on our staging site, but i get an error:

InvalidReferenceException:The following has evaluated to null or missing:
==> page.context.message  [in template "HeadBottomCustom" at line 5, column 79]


Do you have any idea what could go wrong? 

Noémi Balogh

Customer Engagement Expert, Community Admin at Graphisoft

Graphisoft Community

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.