在facebook上分享产品的问题
问题描述:
我正在使用Facebook分享器分享我的网站到Facebook的产品。我试过所有的方法来做到这一点..但我不知道问题在哪里。在facebook上分享产品的问题
当我点击mysite中的facebook图标时,它会重定向到facebook,而不会显示产品名称,产品图片,产品说明。它来到无标题的文件。这里是我使用的代码。
<head>
<meta name="title" content="<?=$fetpro['productname'];?>" />
<meta name="description" content="Join this bloc to help me get a deal at BBuys" />
<meta name="medium" content="medium_type" />
<link rel="image_src" href="http://www.mysite.com/admin/product_images/<?=$fetpro['product_image']?>" />
</head>
<body>
<a href="http://www.facebook.com/sharer.php?u=http://www.mysite.com/details.php?pro_id=<?php echo $fetpro['auto_id'];?>&t=<?php echo $fetpro['productname'];?>&Width=626 &Height=436 &Toolbar=0 &Status=0"><img src="images/facebook.jpg" /></a></body>
plz帮帮我问题在哪里。
答
这是共享内容的旧方法。使用this plugin允许用户共享您网站上的内容... 对于Facebook提取正确的图像和标题以预览您的网站阅读帮助页面关于open graph protocol ...它显示了您确切的meta标签,你必须放置在您的网站上,以便Facebook可以创建正确的预览。
从open graph protocol两者 -
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
<meta property="og:site_name" content="IMDb"/>
<meta property="fb:admins" content="USER_ID"/>
<meta property="og:description"
content="A group of U.S. Marines, under command of
a renegade general, take over Alcatraz and
threaten San Francisco Bay with biological
weapons."/>
...
</head>
...
</html>
我现在正在使用新的格式只有第一个图像共享?因此,我在标题中添加了10个具有相同标记的图像,但只添加了不同的url 。只显示第一个,任何提示? – Tom 2015-07-04 12:37:03