Hi
We've got a cutsomer, who want's to add a Facebook "Like"-button to their newsitems, so that when you open a newsitem, you can choose to "like" it on facebook.
When facebook makes a preview of the page on the users wall, it uses the metatags "Title" and "Description" which is fine, because you can control these for each newsitem. However, facebook also grabs an image from the site, and to control which image is used, you need to have a in the page header.
Is there any way to control this? I've tried changing the value with javascript, but it doesn't work with the facebook robot.
Maybe I'm missing something obvious, but I would appreciate some input on this.
Thanks.
Developer forum
E-mail notifications
News, facebook and metatags
Posted on 07/03/2011 14:59:02
Replies
Nicolai Høeg Pedersen
Posted on 07/03/2011 15:10:03
Hi Gorm, old chap!
You can use a NewsItemDetailsTemplateExtender :
http://engage.dynamicweb-cms.com/Admin/Public/Download.aspx?File=Files%2fFiler%2fDocumentation%2fReleases%2fDynamicweb+7.1%2fTechnical+documentation%2f(en-US)+News+v2+Extensibility.pdf
Article on template extenders:
http://devierkoeden.com/Articles/%5BarticleId/23%5D/Displaying%20Correct%20Add%20to%20and%20Remove%20from%20Favorites%20Links.aspx
In the ExtendTemplate method do like this with the image url:
PageView.Current.Meta.Add("custom", "link rel=""image_src"" src=""[src to image]"" ")
You can find the image source in the extenders newsitem:
MyBase.Item.NewsImage
You can use a NewsItemDetailsTemplateExtender :
http://engage.dynamicweb-cms.com/Admin/Public/Download.aspx?File=Files%2fFiler%2fDocumentation%2fReleases%2fDynamicweb+7.1%2fTechnical+documentation%2f(en-US)+News+v2+Extensibility.pdf
Article on template extenders:
http://devierkoeden.com/Articles/%5BarticleId/23%5D/Displaying%20Correct%20Add%20to%20and%20Remove%20from%20Favorites%20Links.aspx
In the ExtendTemplate method do like this with the image url:
PageView.Current.Meta.Add("custom", "link rel=""image_src"" src=""[src to image]"" ")
You can find the image source in the extenders newsitem:
MyBase.Item.NewsImage
Lise Trabjerg Pedersen
Posted on 18/04/2012 16:39:12
I think I need to do something like this - but I really don't understand it. What to write in my og:image property in order to get the news-image shown on facebook, when a news-item is liked?
I'm using the xfbml method, and has finally got title and description working - but I need a way to get the news picture shown, if it's possible.
Can anybody "translate" the text above with templateExtender and MyBase.Item.NewsImage etc, so that a "not-developer" can understand it, please?
/Lise
http://herningelite.dk/nyhedstest.aspx?PID=295&M=NewsV2&Action=1&NewsId=62
You must be logged in to post in the forum