2011-12-30 191 views
0

如何指定我希望發送按鈕顯示的產品圖像。我希望它在產品頁面上顯示產品,但它似乎只是從頁面中選取隨機圖像。喜歡按鈕,發送按鈕顯示隨機圖片

+0

可能的重複[如何Facebook Sharer選擇圖像?](http://facebook.stackoverflow.com/questions/1138460/how-does-facebook-sharer-select-images) – bkaid 2011-12-31 07:51:19

回答

1

您需要在頁面上添加一些og:tags。請閱讀Open Graph Protocol Documentation瞭解有關不同標籤及其含義的詳細信息。

一個簡單的例子:

<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> 

一旦放置在正確的og:tags並將其值設置,您可以使用URL Debugger看到的Facebook如何看待您的網址。