0

I'm building an image sharing website that has a slideshow view that lets you scroll through all of the images on that page and each image has the option to share it. I want whatever image it is that you're sharing to be used as the display image on your Facebook feed. I know of the meta tags but those can't be dynamically changed, is there no way to pass in an image URL as a parameter? The link that's being shared isn't a direct link to the image, but a link with a parameter that opens that image up in the slideshow.

I'm using this code to share:

    $('#imageViewer').on('click', '.button', function(){
        FB.ui({
            method: 'share',
            href: 'http://myurl.com/?imageID=imageid'
        }, function(response){});
    });
cantread
  • 385
  • 1
  • 6
  • 14

1 Answers1

0

You can't provide a image/picture field with the Share Dialog.

What you can do is create an page that reads the value for the og:image meta tag from the url. That way you can have one generic page that you share that always has the correct image value.

E.g.:

http://domain.com/slide_share.php?image=1234
>>
<meta property="og:image" content="http://domain.com/images/1234.png" />
http://domain.com/slide_share.php?image=2345
>>
<meta property="og:image" content="http://domain.com/images/2345.png" />

You can use the same page as your normal slides-pages, but just make the og:image value dependent on the url parameters.

Roemer
  • 3,506
  • 1
  • 13
  • 31