2012-01-10 43 views
1

我正在列出我的頁面,並且我想爲每個項目添加一個類似按鈕。我怎樣才能做到這一點?在列表中創建一個像按鈕的按鈕

我用這個,在每個項目指定一個不同的URL:

content_tag :iframe, nil, :src => "http://www.facebook.com/plugins/like.php?href=#{url}&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80", :scrolling => 'no', :frameborder => '0', :allowtransparency => true, :id => :facebook_like, :style => "border:none; overflow:hidden; width:70px; height:25px;" 

論等等按鈕的URL,我把自定義元但Facebook不使用它。它只使用我的列表頁面的元。

我該如何強制facebook使用喜歡頁面的元素?

回答

2
How an i do to force facebook to use the metas of the liked page? 

你不能強迫Facebook的使用METAS,因爲他們從你給他們的網址自動完成它。他們把它擦乾淨。你可以看到在行動棉短絨在https://developers.facebook.com/tools/debug


編輯 每下面的評論:

的頁面,類似按鈕位於已指定了以下的iframe:

http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.hoteletlodge.fr%2Fhotel&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80 

所以被喜歡的頁面本身是:http://hoteletlodge.fr/hotel

爲了有一個像按鈕一樣的http://hoteletlodge.fr/hotel/inde/maharajas-express頁面,則需要的iframe的href更改爲:

http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.hoteletlodge.fr%2Fhotel%2Finde%2Fmaharajas-express&layout=standard&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=80 

當你所更改的http://hoteletlodge.fr/hotel,那麼你將需要修復的王公頁面上的OG錯誤。請參閱:http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fhoteletlodge.fr%2Fhotel%2Finde%2Fmaharajas-express

+0

我只想要facebook獲取網址的元數據,而不是類似按鈕的網址元。 – Sebastien 2012-01-11 10:10:22

+0

Facebook已經得到了網址的元素喜歡。它可以不關心類似按鈕所在頁面上的元素。 – DMCS 2012-01-11 16:10:50

+0

這不是我得到的。奇怪... – Sebastien 2012-01-11 17:45:52