Anybody else here, who during the last weeks has experienced, that facebook "like" buttons in News V2 List suddenly don't work anymore?
I have a Dw solution where I have used the standard facebook like button, and another, where I have used "addthis" functionality.
Both was linked up to "http://www.solution.dk/<!--@News:Href-->" and has worked nice before.
But now it is only linking to the site, not the news-item-page.
And I simply can't find a way to repair it.
Have some of you had the same problem - I guess it's a facebook-thing, not a Dw-thing - but still, I would like to hear if some of you have had the same problems, and found a solution?
/Lise
Developer forum
E-mail notifications
Facebook "like" buttons versus News V2
Lise Trabjerg Pedersen
Posted on 11/04/2012 09:42:50
Replies
Lise Trabjerg Pedersen
Posted on 19/04/2012 11:34:17
Next step - I have added the meta.description and the meta.title in the facebook og:properties in head, and is usings these for title and teaser in the news module - works fine. But the image!
Has anybody found a way to "force" facebook to choose the image from the news item, and not a "default" picture, defined in the "og:image" property?
I can see that wordpress and drupal and others has standard scripts, that helps this topic. Would be nice, if Dynamicweb had something like that...
/Lise
Has anybody found a way to "force" facebook to choose the image from the news item, and not a "default" picture, defined in the "og:image" property?
I can see that wordpress and drupal and others has standard scripts, that helps this topic. Would be nice, if Dynamicweb had something like that...
/Lise
Imar Spaanjaars
Posted on 19/04/2012 13:33:20
Hi Lise,
You can accomplish something like this with the Extensibility API; through a TemplateExtender to be exact. Here's a quick example:
This does require some custom coding in the project though. Also, you may need to parse the Item.NewsImage property as, if I am not mistaken, it returns a relative path starting with ..
I agree it would be nice if Dynamicweb had better support for this out of the box, as this is getting more and more common. You may want to request it as a feature in the Feature Requests forum.
Hope this helps,
Imar
You can accomplish something like this with the Extensibility API; through a TemplateExtender to be exact. Here's a quick example:
using System; using Dynamicweb.Frontend; using Dynamicweb.Modules.News.Extensibility; using Dynamicweb.Rendering; namespace CustomModulesDemo { public class AddOgImageMetaTag : NewsItemDetailsTemplateExtender { const string ogMetaTag = "<meta property=\"og:image\" content=\"{0}\"/>"; public override void ExtendTemplate(Template template) { PageView.Current().Meta.Add(String.Format(ogMetaTag, Item.NewsImage); } } }
I agree it would be nice if Dynamicweb had better support for this out of the box, as this is getting more and more common. You may want to request it as a feature in the Feature Requests forum.
Hope this helps,
Imar
Lise Trabjerg Pedersen
Posted on 20/04/2012 14:10:37
I did another thing - and I don't think facebook would recommend it. I removed the og:image property from the master - now the picture from the news item is choosen. But if it will keep on working, i'll just have to wait and see...
You must be logged in to post in the forum