-3

I am sharing a post from my website at Facebook, but I am not getting content of my page like (image, name, etc) I am using Cakephp3 and sharer.php.

There is my code :

<li><a href="http://www.facebook.com/sharer.php?s=100&p[title]=testmobulous&p[url]=https://mobulous.in/vuewa/Vuewa/channel
<?php echo base64_encode(convert_uuencode($channel['id'])); ?>
&p[images][0]=https://mobulous.in/vuewa/Vuewa/webroot/img/
<?php echo $channel['channel_cover_image'] ?>"
onclick="return !window.open(this.href, 'Facebook', 'width=640,height=580')">   
Opsse
  • 1,851
  • 2
  • 22
  • 38

1 Answers1

0

You should use og tags for that, please look up in the documentation. You can test the data which facebook fetches here.

  • og:url - your current url
  • og:type - type of your post, article for example
  • og:title - title of your post, and your site maybe
  • og:description - description of your post, perex for example
  • og:image - url of your image (each image should be in a separate og:image tag)

Example of setting an og tag inside the head tag:

<meta property="og:title" content="Title of my post | My site" />
spielerds
  • 186
  • 1
  • 3
  • Hello friend @spielerds ..i am trying this code ...but it is not helping me ...Please Verify it – Praveen Rai Jun 23 '18 at 13:36
  • It looks good, but the protocol is missing from the url.. `http://` or `https://` should be there.. Or if your site is available through http and https, just put `//` there.. for example, your og:url should look like this: ``.. also, Vuewa video is not a valid og:type, it should be probably `video.other`, like this: ``. Did you put these html tags in the `` section of your site? Does this help? – spielerds Jun 23 '18 at 17:22