Share Facebook

Asked

Viewed 886 times

2

The facebook documentation is kind of flawed. What parameters should I pass to share a product and its photo on facebook coming from a site?

I create the path of the page:

$url = $base_url."index.php/{$controller}/".join('/',$parametros);

And I put as data-href as the API says:

<div class="fb-share-button" data-href="<?php echo $url ?>" data-layout="button_count"></div>
  • How are you doing? Post the code

  • And yet, without the image.

  • Do you have meta tags? http://davidwalsh.name/facebook-meta-tags Then test here: https://developers.facebook.com/tools/debug

2 answers

3

You need to include the meta tag down in your html for the image to be detected in the sharing.

<meta property="og:image" content="LINK_DA_IMAGEM"/>

For more information about meta tags, access https://developers.facebook.com/tools/debug/ and put the link of your page. Other possible meta tags that are missing from your page.

  • Yeah, but only the image it doesn’t even have to include because if the image is in the document, it will pick up anyway. But for a perfect share, it has to insert is OPEN GRAPH, and not only the goal.............

-2

The properties of the link are not specified in the button. In case you would have to use the Js dialog ui.feed that will be able to specify the sharing information explicitly, but the ideal ai is neither uifeed nor share button, just implement a like.. Like button.. And put properties to be recommend (not a product??) and enable share. Will appear both. Now as for the image you will have to implement the open Graph .

With open Graph shares through the link, it and property a URL, if the comrade has a page of A product is what he has to do even. But he’ll have to implement the whole thing. If it’s an application it can do a posting dialog, in this case fb.ui or fb.feed do not know.There used to specify image title and sub description of a post. He can direct to the app, and he can load a variable, he could also put an action button on the post made, and this button returned the variable. Today the link should have details and it will be a rich product type object. learn only, read the documentation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.