2011-08-31 42 views
1

同一頁面按鈕是否可以添加兩個按鈕像在同一頁上:兩次FB喜歡與不同的標題,描述和圖片

  • 第一:引用http://www.mysite.com,有一個標題,圖像和說明具體到主頁
  • 第二:引用http://www.mysite.com/article?id=511,有一個標題,描述和具體的形象第511

回答

1

退房的open graph protocol文檔,您需要爲依賴新生正確的標籤你在哪個頁面上。

例如,在主頁上:

<meta property="og:title" content="My Site Name" /> 
<meta property="og:type" content="website" /> 
<meta property="og:url" content="http://www.mysite.com" /> 
<meta property="og:image" content="img" /> 

並在第六頁:

<meta property="og:title" content="My Article Title" /> 
<meta property="og:type" content="article" /> 
<meta property="og:url" content="http://www.mysite.com/article?id=511" /> 
<meta property="og:image" content="img2" /> 
<meta property="og:description" content="My article description" /> 
<meta property="og:site_name" content="My Site Name" /> 

然後就成爲像按鈕上的任何頁面,您希望這些不同的URL。

+0

我想我已經解釋得很厲害,要不然我誤解你的迴應:) 我希望我有一個頁面上的兩個按鈕: -the第一:具體在整個網站的標題的網站「之類的網站」 第二:專爲文章在身體「文章」。 在同一頁。 有可能在同一頁面中使用許多元OG? – ranell

+0

不,它是每個對象的一組元標記。但是,一旦您配置了每個對象,您就可以在頁面上擁有儘可能多的按鈕,從而引用不同的對象。因此,您需要使用兩套獨立的標籤設置兩個單獨的頁面,然後在「fb:like」標籤中引用這些頁面。 –

+0

不錯,有效!謝謝 :) – ranell

0

是的,只需將每個按鈕上的href屬性設置爲相應的URL即可。

相關問題