How to add Facebook Open Graph (og) meta tags to blog details page

Vuthy Sok asked on October 20, 2016 10:53

Dear All,

I am New Kentico Developer could you help me how to integrate share blog page to Facebook, Twitter and linkined. I have google but can't resolution.

Here my Code

<meta property="og:title" content="{% BlogPostTitle %}" />
<meta property="og:site_name" content="Dahlin Development" />
<meta property="og:url" content="{% CurrentDocument.AbsoluteURL}" />
<meta property="og:description" content="{% StripTags(BlogPostSummary) %}" />
<meta property="og:image" content="{% BlogPostTeaser %}" />
<meta property="og:type" content="article" />

The issue {% BlogPostTeaser %} not show correct path of image. <meta property="og:image" content="6e342d22-d3f6-4773-b589-769d168c0c6b" />

Do you have any idea show image correct path?


Correct Answer

Dawid Jachnik answered on October 20, 2016 11:40


Just wrap it

<meta property="og:image" content="/getattachment/{% BlogPostTeaser %}/.aspx" />
1 votesVote for this answer Unmark Correct answer

Recent Answers

Peter Cranston answered on October 20, 2016 11:40

BlogPostTeaser evaluates to the GUID of the image attachment, not the image path.

One way to get the image would be to set the tag as follows:

<meta property="og:image" content="http://{yourdomain}/getattachment/{% BlogPostTeaser %}" />

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.