Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing title, url and image on share.php of facebook

I want to share title , image and description on facebook without javascript just by passing these to share.php of facebook. I got some code on this site in question Open source alternative to AddThis AddToAny, ShareThis etcfor Social Bookmarking

and I have read the question how to pass custom parameter in facebook sharer link

Now I want to combine both questions. Can I pass Image, title and description simply in the facebook share.php url

like:

<a class="scmFacebook" href='http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $title;?>&amp;p[summary]=<?php echo $summary;?>&amp;p[url]=<?php echo $url; ?>&amp;&p[images][0]=<?php echo $image;?>'>Facebook</a>

OR If I am wrong then please show me the right destination.

like image 753
user3739733 Avatar asked Jun 20 '14 07:06

user3739733


People also ask

Can you post a picture with a hyperlink on Facebook?

Adding Clickable ImagesCopy the URL you want to link the images to your post. All of the valid images on the page will then automatically appear in the post. If there is more than one image on the website page, you will see arrows to the left and right allowing you to scroll through the images.


1 Answers

According to the facebook developers (bug):

The sharer will no longer accept custom parameters and facebook will pull the information that is being displayed in the preview the same way that it would appear on facebook as a post from the url OG meta tags.

  1. Either you use the Share Button - requires Javascript SDK

  2. Or, use the latest Share Dialog - requires just an app id. It has a direct url direction method for invoking the share dialog:

    https://www.facebook.com/dialog/share?
      app_id={app-id}
      &display=popup
      &href={link-to-share}
      &redirect_uri={redirect-uri}
    
like image 149
Sahil Mittal Avatar answered Oct 08 '22 05:10

Sahil Mittal