0

对于这个项目http://www.cinematheque.fr/expositions-virtuelles/kubrick_web/index.php我正在尝试为所有页面设置一个类似 FB 的按钮(见右上角)。

喜欢按钮 iframe:

<iframe id="fb" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.cinematheque.fr%2Fexpositions-virtuelles%2Fkubrick_web%2Findex.php&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=lucida+grande&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

我正在尝试使用与页面相关的值来设置 OpenGraph 元标记,特别是og:image(因为该网站是一个艺术画廊,每个页面都显示了我想用作类似插图的不同视觉作品)。因此,我想将网站拥有一个独特的点赞计数器的好处与 FB 墙故事中的各种数据和插图结合起来,具体取决于您在单击“点赞”按钮时所处的实际页面。

元标记:

<meta property="og:title" content="Kubrick et le web" />
<meta property="og:type" content="director" />
<meta property="og:description" content="Graphistes, vid&eacute;astes, stylistes, plasticiens : toute une g&eacute;n&eacute;ration de cr&eacute;ateurs talentueux s'est pench&eacute;e depuis 15 ans sur l'&oelig;uvre kubrickienne pour lui rendre hommage, la questionner, la remixer. D&eacute;couvrez notre portfolio, plus de 200 cr&eacute;ations d&eacute;couvertes sur le web." />
<meta property="og:url" content="http://www.cinematheque.fr/expositions-virtuelles/kubrick_web/index.php" />
<meta property="og:site_name" content="La Cin&eacute;math&egrave;que fran&ccedil;aise" />
<meta property="fb:app_id" content="24658885765" />
<meta property="og:image" content="http://www.cinematheque.fr/expositions-virtuelles/kubrick_web/images/600/201-1.jpg" />

为了与 一致iframe,我对整个站点的标记使用相同的值og:url(= 主页 URL),但这可能是错误的。

但是,它没有按预期工作,因为 FB 故事没有显示正确的页面特定插图,而是我为主页指示的通用图像。

你能告诉我我正在尝试做什么(一个计数器/逐页元数据)是否有效以及如何去做?

4

1 回答 1

0

我认为您正在尝试做的事情在语义上是错误的。喜欢按钮是特定于对象的,在您的情况下,它应该是用户在您的网站中喜欢的特定图像。

为了显示您网站的总点赞数,您可以使用图形 api 并将所有对象(所有图像)的所有点赞数相加。

要计算对象的喜欢,请参阅此

http://developers.facebook.com/docs/reference/fql/like/

于 2011-03-24T10:29:55.810 回答