开发者

How to customize the facebook like button dynamically for each different page

i want the item name (in the page title) to post back to facebook...

   <iframe src="http://www.facebook.com/plugins/like.php?href=rent.neighborrow.com/items/view/<?= $ite开发者_开发问答m["Item"]["item"];?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:; width:450px; height: 30px; text-align: center;margin-top: 10px;"></iframe>


I'm not positive if this is what you are asking, but I think you want to use the opengraph meta tags.

http://developers.facebook.com/docs/opengraph

<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"/>
</head>

Once a user clicks on the "like" button facebook makes a webservice call that scrapes the opengraph meta tags on your site to build a graph object. You want to set the "og:title".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜