htmlcssfacebookcustom-code

Facebook sharing window - how do i edit?


Im trying to make a Facebook sharing button with the custom code option in the quiz service i'm using. I've managed to make the button with titel, button graphic and sharing feature.

The issue im having is, that the "sharing window" opens a new browser tab fullscreen, that doesn't grap any graphical image but only meta text from the quiz.

Does anyone know how i edit the custom code to share an image also?

The current custom code im using is:

<div><a title="Del på Facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://surveyanyplace.com/s/gofilmquiz" target="_blank"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://www.canaldigital.dk/Global/Tests/del-paa-Facebook.png" alt="Deling"></a></div>


Solution

  • You can only share an URL with sharer.php, the image will be collected from the URL if you add the og:image tag.

    You can also use the Feed Dialog instead and specify the image on your own: https://developers.facebook.com/docs/sharing/reference/feed-dialog/

    Btw, you can open a small window with JavaScript instead of a new fullscreen tab. Just use window.open with sharer.php.