-1

I have added two like-buttons to my images on my website but when you click like and you want to share them, the room for the picture is blank. How can I get the picture to show in the share box and to display on Facebook?

My website is www.firamedmariamontazami.se

glautrou
  • 3,140
  • 2
  • 29
  • 34

2 Answers2

0

Could you try uploading a photo at a smaller resolution so that we can test? I'm wondering whether facebook is misbehaving because it's too large.

mtpbzz
  • 308
  • 2
  • 12
0

Documentation:

href - the URL to like. The XFBML version defaults to the current page. Note: After July 2013 migration, href should be an absolute URL

Can you confirm that href is an absolute URL?

If yes, try to include OpenGraph metas on your targeted pages (page specified in href) like:

<meta property="og:image" content="http://website.com/image.jpg" />

Do not forget to check the size of your image, you can find more details in this discussion

Edit:

Copy your link on the Facebook Object Debugger page and check what Facebook says about your image, that would help to get more details.

Update: About your question:

Can I use different metas with different pictures? I want ten different pictures on my page that you can share.

Look at this paragraph in the documentation, you can specify many images and your first image tag will be given the preference during conflicts. Keep in mind that when you share something on Facebook only one image will be displayed.

You may also be interested by setting other OpenGraph metas so if someone share your page (copy/paste your URL in Facebook) a nice summary of your page will be displayed (title, description, image...).

Community
  • 1
  • 1
glautrou
  • 3,140
  • 2
  • 29
  • 34
  • Thank you so much, I will try metas. Can I use different metas with different pictures? I want ten different pictures on my page that you can share. – user2677729 Aug 13 '13 at 08:35
  • Yes it is possible, please look at my updated answer. – glautrou Aug 13 '13 at 08:48
  • I´ve tried now to put in meta-tags with these attributes: but when I try to share it, no picture is shown. – user2677729 Aug 13 '13 at 08:55
  • Debug your URL in the [Facebook Object Debugger](https://developers.facebook.com/tools/debug) and fix the issues mentioned by Facebook. Also make sure your image is correct as specified in the link of my answer. – glautrou Aug 13 '13 at 09:00
  • The Debugger only says that it couldnt fetch any data from the URL but I have used an absolute URL as I should. Should I use the Graph API to something? – user2677729 Aug 13 '13 at 09:14
  • No you shouldn't use the Graph API, this is different. You you give me your URL? If Facebook cannot fetchh any data from your URL make sure your page is publicly visible and your OpenGraph `metas` are in the `head` tag of your page. – glautrou Aug 13 '13 at 09:19
  • Note: I posted the link from your question on my Facebook timeline + object debugger and everything is fine, your image is correctly displayed. – glautrou Aug 13 '13 at 09:22
  • When you post the link directly to Facebook it is working fine but it is not working when you share it from my website through the button. Have you tried sharing it from http://www.firamedmariamontazami.se? I have checked and my metas are in the head tag of my page. Thanks again! – user2677729 Aug 13 '13 at 16:07
  • Look at my last paragraph [here](http://stackoverflow.com/a/18055274/1635807), you need to scrape your page. You can use the method to make an HTTP request to the Facebook Object Debugger page (with your URL in query string) or use `curl`. Please mark the answer to your question as solved if it is. – glautrou Aug 13 '13 at 16:13
  • I have scraped my page and now it seems to work with the first picture in my meta tags but it doesnt work with the other pictures I also want to share. – user2677729 Aug 13 '13 at 16:38
  • That's because Facebook uses and cache only one image from meta tags, you don't share images but an article with an attached image. So your Facebook integration works :) – glautrou Aug 13 '13 at 16:44
  • Ok, so its not possible to share one specific picture? And if you use arrays of meta tags, it is only if the first picture doesnt work for some reason? – user2677729 Aug 13 '13 at 19:09
  • The protocol says it is possible to share multiple images via meta tags but Facebook only uses one of them. It is also said on the documentation that the client should use the default image by default if it doesn't support multiple images. Therefore if you correctly scrape your page with Facebook and use multiple images only the first one will be displayed. – glautrou Aug 13 '13 at 20:06
  • Ok, thank you so much for your help! One last thing, I can´t seem to find where I mark my question as solved? Is it the same as accepting an answer? – user2677729 Aug 13 '13 at 20:54
  • You are welcome, I already faced your issues ;) Yes it is ok, thanks – glautrou Aug 13 '13 at 21:24