views:

145

answers:

3

We are using Facebook's sharer.php service to share pages on our site. Right now this works great, but we are now having difficult trying to find out how to offer users more than one thumbnail to pick from (the sharer.php page offers a UI for multiple images, so it must be possible somehow).

We have this meta tag currently:

<meta property="og:image" content="http://www.mysite.com/myimage.jpg" />

We couldn't find anything suggesting how to do this. Does anybody have any ideas?

A: 

The og:image meta tag you are using is called by Facebook's servers after the user clicks your share button. So if you are trying to change this and have the person click the share button, this won't work. If you want to support multiple og:images on your page you could use different query parameters for each image.

For example: http://www.mysite.com/mypage?image=myimage.jpg would render the metatag like

Then you could also have for example: http://www.mysite.com/mypage?image=anotherimage.jpg that would render the metatag like

Another way you could do this is would just be to ask the user for stream_publish permission and use the Graph API to send the post directly to facebook yourself. You can find out more about this approach here: http://developers.facebook.com/docs/reference/api/post

Nathan Totten
A: 

Your metatag examples didn't render (you probably didn't put them in a code block)... but I'm assuming they were showing a different og:image tag returned based on the querystring passed in.

I appreciate your help, but this isn't quite what we want. Yes, the Facebook servers call back to get the page (and metatags), but the UI pressented to the user shows the ability to select more than one thumbnail.

Right now all our pages show "Thumbnail (1 of 1)" and have the thumbnail selector buttons greyed out. So, I was hoping that there would be a way to list multiple og:image tags, or have one og:image with multiple delimited images within it.

Having the querystring doesn't really work, as that would require the user choosing the thumbnail before clicking through to sharer.php.

And we did look at the Graph API, but have discounted this as it seems to make sharing too hard for the user. Asking users to accept a "trust our site" Facebook dialog in order to directly post to their pages doesn't seem like a good idea.

If anyone knows if it's possible to on a single page to have metatags formatted in such a way that Facebook sharer.php can give the user the option of choosing from more than one thumbnail, it would be appreciated!

codinginthevoid
A: 

I found a solution to this by adding the images to the body and not in the meta information, then just hiding them, like this;

<body> ...

<img src="http://image1" width="41" height="41" border="0" alt="text describing the image" style="visibility:hidden" /><br/>

<img src="http://image2" width="41" height="41" border="0" alt="text describing the image" style="visibility:hidden" /><br/>

etc ... </body>

It just came to me from reading that if no og:image property is given then thumbnails are taken from the body, and it worked even if hidden. You could probably remove the width, heigh etc to tidy it up, but I thought why both waste time with that when it gets hidden anyway, I just cut and paste and made it hidden.

Hope this helps.

Stuart

related questions