2012-04-16 79 views
4

我使用Facebook應用程序(shortstack)來製作我的頁面。 我想在個人化發佈時與短網址分享。 我有測試創建一個開放的圖元標籤,但它不工作。打開圖片元標記

回答

6

你需要把opengraph meta標籤在你的頁面一樣

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

例子在這裏找到http://developers.facebook.com/docs/opengraphprotocol/

你還需要到頂部標籤更改爲

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:og="http://ogp.me/ns#" 
    xmlns:fb="http://www.facebook.com/2008/fbml"> 

然後它應該工作正常:)

調試您的網頁,看看你是否rrectly實施opengraph標籤使用調試工具在這裏:http://developers.facebook.com/tools/debug/

希望幫助

+1

謝謝您的效應初探它是爲我好 – 2012-04-30 22:36:48

+0

對於簡單的測試,您可以粘貼HTML片段,並使用該工具的http網上發佈:/ /www.golery.com/posthtml然後嘗試與facebook debgger developers.facebook.com/tools/debug 請注意,Facebook緩存圖像,所以你需要問問facebook調試器刷新幾次。 – greensuisse 2017-06-06 20:21:37